[asterisk-commits] dvossel: branch 1.8 r281432 - in /branches/1.8: ./ channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Aug 9 15:47:58 CDT 2010


Author: dvossel
Date: Mon Aug  9 15:47:53 2010
New Revision: 281432

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=281432
Log:
Merged revisions 281430 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r281430 | dvossel | 2010-08-09 15:46:50 -0500 (Mon, 09 Aug 2010) | 13 lines
  
  fixes SIP peers memory leak
  
  We zeroed out the peer's addr before it was removed from the
  peers_by_ip container.  This made it impossible to be removed
  from the container as the addr is the key used by the container
  to find the peer.
  
  (closes issue #17774)
  Reported by: kkm
  Patches:
        017774-sip-peer-leak-1.6.2.10.diff uploaded by kkm (license 888)
        017774-sip-peer-leak-1.8.diff uploaded by kkm (license 888)
........

Modified:
    branches/1.8/   (props changed)
    branches/1.8/channels/chan_sip.c

Propchange: branches/1.8/
------------------------------------------------------------------------------
--- branch-1.6.2-merged (original)
+++ branch-1.6.2-merged Mon Aug  9 15:47:53 2010
@@ -1,1 +1,1 @@
-/branches/1.6.2:1-279056,279207,279501,279561,279597,279609,279657,279784,279849,279946,280089,280160,280193,280229,280231,280306,280345,280449,280551,280671,280739,280983,281051,281391
+/branches/1.6.2:1-279056,279207,279501,279561,279597,279609,279657,279784,279849,279946,280089,280160,280193,280229,280231,280306,280345,280449,280551,280671,280739,280983,281051,281391,281430

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=281432&r1=281431&r2=281432
==============================================================================
--- branches/1.8/channels/chan_sip.c (original)
+++ branches/1.8/channels/chan_sip.c Mon Aug  9 15:47:53 2010
@@ -12652,7 +12652,6 @@
 
 	peer->expire = -1;
 	peer->portinuri = 0;
-	memset(&peer->addr, 0, sizeof(peer->addr));
 
 	destroy_association(peer);	/* remove registration data from storage */
 	set_socket_transport(&peer->socket, peer->default_outbound_transport);
@@ -12680,6 +12679,10 @@
 			ao2_t_unlink(peers_by_ip, peer, "ao2_unlink of peer from peers_by_ip table");
 		}
 	}
+
+	/* Only clear the addr after we check for destruction.  The addr must remain
+	 * in order to unlink from the peers_by_ip container correctly */
+	memset(&peer->addr, 0, sizeof(peer->addr));
 
 	unref_peer(peer, "removing peer ref for expire_register");
 




More information about the asterisk-commits mailing list