[asterisk-commits] res pjsip: Fix some off nominal tdata leaks. (asterisk[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Feb 7 09:44:11 CST 2017


Anonymous Coward #1000019 has submitted this change and it was merged. ( https://gerrit.asterisk.org/4889 )

Change subject: res_pjsip: Fix some off nominal tdata leaks.
......................................................................


res_pjsip: Fix some off nominal tdata leaks.

Change-Id: I243a4be5e7fbfe604923764969c4ee04eee89b9d
---
M res/res_pjsip.c
M res/res_pjsip_mwi.c
2 files changed, 3 insertions(+), 0 deletions(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, approved



diff --git a/res/res_pjsip.c b/res/res_pjsip.c
index 82d06dc..347c579 100644
--- a/res/res_pjsip.c
+++ b/res/res_pjsip.c
@@ -3551,6 +3551,7 @@
 
 	if (!cb && token) {
 		/* Silly.  Without a callback we cannot do anything with token. */
+		pjsip_tx_data_dec_ref(tdata);
 		return PJ_EINVAL;
 	}
 
diff --git a/res/res_pjsip_mwi.c b/res/res_pjsip_mwi.c
index 925556e..e625df7 100644
--- a/res/res_pjsip_mwi.c
+++ b/res/res_pjsip_mwi.c
@@ -502,6 +502,7 @@
 	body.subtype = MWI_SUBTYPE;
 	body_text = ast_str_create(64);
 	if (!body_text) {
+		pjsip_tx_data_dec_ref(tdata);
 		return 0;
 	}
 
@@ -517,6 +518,7 @@
 	if (ast_sip_pubsub_generate_body_content(body.type, body.subtype, &body_data, &body_text)) {
 		ast_log(LOG_WARNING, "Unable to generate SIP MWI NOTIFY body.\n");
 		ast_free(body_text);
+		pjsip_tx_data_dec_ref(tdata);
 		return 0;
 	}
 

-- 
To view, visit https://gerrit.asterisk.org/4889
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I243a4be5e7fbfe604923764969c4ee04eee89b9d
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>



More information about the asterisk-commits mailing list