From: Terry Wilson Date: Mon, 17 Oct 2011 15:39:07 +0000 (+0000) Subject: Don't try to remove peers without IPs from peers_by_ip X-Git-Tag: 10.0.0-rc1~71 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f99e9b5badf8c2ac136c71927213b76ccf950867;p=thirdparty%2Fasterisk.git Don't try to remove peers without IPs from peers_by_ip (closes issue ASTERISK-18696) ........ Merged revisions 341088 from http://svn.asterisk.org/svn/asterisk/branches/1.8 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@341089 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index ff24757821..17ec5793a9 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -27309,7 +27309,9 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str 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 (!ast_sockaddr_isnull(&peer->addr)) { + ao2_t_unlink(peers_by_ip, peer, "ao2_unlink peer from peers_by_ip table"); + } if (!(peer->the_mark)) firstpass = 0; } else {