[asterisk-commits] schmidts: branch 1.8 r335259 - /branches/1.8/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Sep 12 06:09:25 CDT 2011


Author: schmidts
Date: Mon Sep 12 06:09:19 2011
New Revision: 335259

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=335259
Log:
build_peer doesnt unlink a peer object from peers_by_ip container which leads to a wrong refcounter value.
adding an ao2_unlink from the peers_by_ip container fix it.

Review: https://reviewboard.asterisk.org/r/1428/


Modified:
    branches/1.8/channels/chan_sip.c

Modified: branches/1.8/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/channels/chan_sip.c?view=diff&rev=335259&r1=335258&r2=335259
==============================================================================
--- branches/1.8/channels/chan_sip.c (original)
+++ branches/1.8/channels/chan_sip.c Mon Sep 12 06:09:19 2011
@@ -26562,6 +26562,9 @@
 	if (peer) {
 		/* Already in the list, remove it and it will be added back (or FREE'd)  */
 		found++;
+		/* we've unlinked the peer from the peers container but not unlinked from the peers_by_ip container yet
+		  this leads to a wrong refcounter and the peer object is never destroyed */
+		ao2_t_unlink(peers_by_ip, peer, "ao2_unlink peer from peers_by_ip table");
 		if (!(peer->the_mark))
 			firstpass = 0;
 	} else {




More information about the asterisk-commits mailing list