]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix another spot where an iax2_peer would be leaked if realtime was in use.
authorRussell Bryant <russell@russellbryant.com>
Tue, 14 Aug 2007 18:49:10 +0000 (18:49 +0000)
committerRussell Bryant <russell@russellbryant.com>
Tue, 14 Aug 2007 18:49:10 +0000 (18:49 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79470 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_iax2.c

index 9319393319a2dfe2714767aee49dd08eee5a4276..ed89bc961fdec47b702816f37593d3e02dc4cef2 100644 (file)
@@ -5284,8 +5284,11 @@ static int authenticate_reply(struct chan_iax2_pvt *p, struct sockaddr_in *sin,
                        ast_mutex_unlock(&iaxsl[callno]);
                        if ((peer = realtime_peer(peer_name, NULL))) {
                                ast_mutex_lock(&iaxsl[callno]);
-                               if (!(p = iaxs[callno]))
+                               if (!(p = iaxs[callno])) {
+                                       if (ast_test_flag(peer, IAX_TEMPONLY))
+                                               destroy_peer(peer);
                                        return -1;
+                               }
                                res = authenticate(p->challenge, peer->secret,peer->outkey, authmethods, &ied, sin, &p->ecx, &p->dcx);
                                if (ast_test_flag(peer, IAX_TEMPONLY))
                                        destroy_peer(peer);