From: Russell Bryant Date: Mon, 7 Jul 2008 11:53:52 +0000 (+0000) Subject: As pointed out on the -dev list, actually use the result of find_peer() so that X-Git-Tag: 1.6.2.0-beta1~1753 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=69782233e425e33140e2581e22cc1b65af6a2196;p=thirdparty%2Fasterisk.git As pointed out on the -dev list, actually use the result of find_peer() so that a peer reference is not leaked. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@128564 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 93bc400e3a..83b9a7ebb3 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -11687,8 +11687,9 @@ static enum check_auth_result check_peer_ok(struct sip_pvt *p, char *of, peer = find_peer(of, NULL, TRUE, FALSE); /* If not found, then find device on IP (if it's not a SUBSCRIBE) */ - if (!peer && sipmethod != SIP_SUBSCRIBE) - find_peer(NULL, &p->recv, TRUE, FALSE); + if (!peer && sipmethod != SIP_SUBSCRIBE) { + peer = find_peer(NULL, &p->recv, TRUE, FALSE); + } if (!peer) { if (debug)