From: George Joseph Date: Wed, 3 Jun 2015 18:17:58 +0000 (-0600) Subject: res_pjsip/location: Fix ref leak in contact_apply_handler X-Git-Tag: 13.5.0-rc1~110 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5dc9fb4198f2081f3996c89fb42aaffc0f326df8;p=thirdparty%2Fasterisk.git 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 --- diff --git a/res/res_pjsip/location.c b/res/res_pjsip/location.c index 9e75929d78..37f39ba30f 100644 --- a/res/res_pjsip/location.c +++ b/res/res_pjsip/location.c @@ -889,6 +889,7 @@ static int contact_apply_handler(const struct ast_sorcery *sorcery, void *object struct ast_sip_contact *contact = object; status = ast_res_pjsip_find_or_create_contact_status(contact); + ao2_cleanup(status); return status ? 0 : -1; }