[Asterisk-code-review] res_pjsip, res_pjsip_session: initialize local variables (asterisk[17])
George Joseph
asteriskteam at digium.com
Wed Oct 28 09:51:33 CDT 2020
George Joseph has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/15083 )
Change subject: res_pjsip, res_pjsip_session: initialize local variables
......................................................................
res_pjsip, res_pjsip_session: initialize local variables
This patch initializes a couple of local variables to some default values.
Interestingly, in the 'pj_status_t dlg_status' case the value not being
initialized caused memory to grow, and not be recovered, in the off nominal
path (at least on my machine).
Change-Id: I22ee65e1e1bff8efacea8a167c6c8428898523f7
---
M res/res_pjsip/pjsip_transport_management.c
M res/res_pjsip_session.c
2 files changed, 2 insertions(+), 2 deletions(-)
Approvals:
Joshua Colp: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved; Approved for Submit
diff --git a/res/res_pjsip/pjsip_transport_management.c b/res/res_pjsip/pjsip_transport_management.c
index af572d3..e14c8e9 100644
--- a/res/res_pjsip/pjsip_transport_management.c
+++ b/res/res_pjsip/pjsip_transport_management.c
@@ -78,7 +78,7 @@
static void *keepalive_transport_thread(void *data)
{
struct ao2_container *transports;
- pj_thread_desc desc;
+ pj_thread_desc desc = { 0 };
pj_thread_t *thread;
if (pj_thread_register("Asterisk Keepalive Thread", desc, &thread) != PJ_SUCCESS) {
diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c
index a4236be..cffb319 100644
--- a/res/res_pjsip_session.c
+++ b/res/res_pjsip_session.c
@@ -3752,7 +3752,7 @@
pjsip_dialog *dlg;
pjsip_inv_session *inv_session;
unsigned int options = endpoint->extensions.flags;
- pj_status_t dlg_status;
+ pj_status_t dlg_status = PJ_EUNKNOWN;
if (pjsip_inv_verify_request(rdata, &options, NULL, NULL, ast_sip_get_pjsip_endpoint(), &tdata) != PJ_SUCCESS) {
if (tdata) {
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/15083
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 17
Gerrit-Change-Id: I22ee65e1e1bff8efacea8a167c6c8428898523f7
Gerrit-Change-Number: 15083
Gerrit-PatchSet: 2
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20201028/61a01213/attachment.html>
More information about the asterisk-code-review
mailing list