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

George Joseph asteriskteam at digium.com
Wed Jun 3 13:25:00 CDT 2015


George Joseph has uploaded a new change for review.

  https://gerrit.asterisk.org/577

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(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/77/577/1

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: newchange
Gerrit-Change-Id: Icc1401cae142855a1abc86ab5179dfb3ee861c40
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: George Joseph <george.joseph at fairview5.com>



More information about the asterisk-code-review mailing list