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)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@281430 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.6.2
David Vossel 16 years ago
parent e4e473991e
commit 4b089171ef

@ -12114,7 +12114,6 @@ static int expire_register(const void *data)
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);
@ -12142,6 +12141,10 @@ static int expire_register(const void *data)
}
}
/* 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");
return 0;

Loading…
Cancel
Save