diff options
author | Russell Bryant <russell@russellbryant.com> | 2008-07-07 11:53:52 +0000 |
---|---|---|
committer | Russell Bryant <russell@russellbryant.com> | 2008-07-07 11:53:52 +0000 |
commit | 69782233e425e33140e2581e22cc1b65af6a2196 (patch) | |
tree | 646572ed21aa0cad9e0a7a0cf3d546bec57fd42a /channels/chan_sip.c | |
parent | e18e81381406abf5e8c071743710baa5dcf3dfc3 (diff) |
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
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r-- | channels/chan_sip.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 93bc400e3..83b9a7ebb 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) |