[Asterisk-cvs] asterisk/channels chan_sip.c,1.714,1.715

kpfleming at lists.digium.com kpfleming at lists.digium.com
Sun May 1 19:10:14 CDT 2005


Update of /usr/cvsroot/asterisk/channels
In directory localhost.localdomain:/tmp/cvs-serv23448

Modified Files:
	chan_sip.c 
Log Message:
ensure object reference is removed after unlinking from container


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.714
retrieving revision 1.715
diff -u -d -r1.714 -r1.715
--- chan_sip.c	1 May 2005 23:07:05 -0000	1.714
+++ chan_sip.c	1 May 2005 23:17:12 -0000	1.715
@@ -4717,8 +4717,10 @@
 	register_peer_exten(peer, 0);
 	peer->expire = -1;
 	ast_device_state_changed("SIP/%s", peer->name);
-	if (ast_test_flag(peer, SIP_SELFDESTRUCT) || ast_test_flag((&peer->flags_page2), SIP_PAGE2_RTAUTOCLEAR))
-		ASTOBJ_CONTAINER_UNLINK(&peerl, peer);
+	if (ast_test_flag(peer, SIP_SELFDESTRUCT) || ast_test_flag((&peer->flags_page2), SIP_PAGE2_RTAUTOCLEAR)) {
+		peer = ASTOBJ_CONTAINER_UNLINK(&peerl, peer);
+		ASTOBJ_UNREF(peer, sip_destroy_peer);
+	}
 
 	return 0;
 }




More information about the svn-commits mailing list