[asterisk-commits] res pjsip/location: Fix ref leak in contact apply handler (asterisk[13])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jun 3 13:39:13 CDT 2015


Joshua Colp has submitted this change and it was merged.

Change subject: res_pjsip/location: Fix ref leak in contact_apply_handler
......................................................................


res_pjsip/location: Fix ref leak in contact_apply_handler

contact_apply_handler calls ast_res_pjsip_find_or_create_contact_status
to force the creation of a contact_status object whenever a new
contact is added but it didn't unref the returned object.

Added an ao2_cleanup(status) to plug the leak.

ASTERISK-25141

Change-Id: Icc1401cae142855a1abc86ab5179dfb3ee861c40
Reported-by: Corey Farrell
---
M res/res_pjsip/location.c
1 file changed, 1 insertion(+), 0 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, approved; Verified
  Corey Farrell: Looks good to me, but someone else must approve



diff --git a/res/res_pjsip/location.c b/res/res_pjsip/location.c
index 9e75929..37f39ba 100644
--- a/res/res_pjsip/location.c
+++ b/res/res_pjsip/location.c
@@ -889,6 +889,7 @@
 	struct ast_sip_contact *contact = object;
 
 	status = ast_res_pjsip_find_or_create_contact_status(contact);
+	ao2_cleanup(status);
 
 	return status ? 0 : -1;
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icc1401cae142855a1abc86ab5179dfb3ee861c40
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: George Joseph <george.joseph at fairview5.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>



More information about the asterisk-commits mailing list