diff options
author | Terry Wilson <twilson@digium.com> | 2011-10-17 15:45:18 +0000 |
---|---|---|
committer | Terry Wilson <twilson@digium.com> | 2011-10-17 15:45:18 +0000 |
commit | 2cb5178d296db20ff43f686423abe453233edff7 (patch) | |
tree | 5687662fcbf42ad8bff5182a6180351283f071a7 /channels/chan_sip.c | |
parent | c292e39cdc62756eb0219aeddebedca52860d961 (diff) |
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
........
Merged revisions 341089 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@341090 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r-- | channels/chan_sip.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index ff9689895..319ce5769 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -27372,7 +27372,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 { |