[asterisk-commits] chan sip: Fix reference leak in mwi event cb (asterisk[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jul 14 04:54:48 CDT 2016


Joshua Colp has submitted this change and it was merged.

Change subject: chan_sip: Fix reference leak in mwi_event_cb
......................................................................


chan_sip: Fix reference leak in mwi_event_cb

Cleanup the peer reference when stasis_subscription_final_message is
true.  Also free peer_name even if peer exists, after reload a new
peer_name will be allocated.

ASTERISK-26193 #close

Change-Id: If7ecd52facdc5c227f701c760841e3f6ca53cc69
---
M channels/chan_sip.c
1 file changed, 2 insertions(+), 4 deletions(-)

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



diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 599ecd6..b2522b6 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -17229,10 +17229,8 @@
 	struct sip_peer *peer = sip_find_peer(peer_name, NULL, TRUE, FINDALLDEVICES, FALSE, 0);
 
 	if (stasis_subscription_final_message(sub, msg)) {
-		if (peer) {
-			/* configuration reloaded */
-			return;
-		}
+		/* peer can be non-NULL during reload. */
+		ao2_cleanup(peer);
 		ast_free(peer_name);
 		return;
 	}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If7ecd52facdc5c227f701c760841e3f6ca53cc69
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>



More information about the asterisk-commits mailing list