[asterisk-commits] russell: branch 1.4 r80499 - /branches/1.4/channels/chan_iax2.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Aug 23 12:02:51 CDT 2007


Author: russell
Date: Thu Aug 23 12:02:50 2007
New Revision: 80499

URL: http://svn.digium.com/view/asterisk?view=rev&rev=80499
Log:
Fix some code where it was possible for a reference to a peer to not get
released when it should.  Thank you to Marta Carbone for pointing this out!

Modified:
    branches/1.4/channels/chan_iax2.c

Modified: branches/1.4/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_iax2.c?view=diff&rev=80499&r1=80498&r2=80499
==============================================================================
--- branches/1.4/channels/chan_iax2.c (original)
+++ branches/1.4/channels/chan_iax2.c Thu Aug 23 12:02:50 2007
@@ -5432,10 +5432,12 @@
 			    /* No specified host, or this is our host */
 				) {
 				res = authenticate(p->challenge, peer->secret, peer->outkey, authmethods, &ied, sin, &p->ecx, &p->dcx);
-				peer_unref(peer);
-				if (!res)
-					break;	
+				if (!res) {
+					peer_unref(peer);
+					break;
+				}
 			}
+			peer_unref(peer);
 		}
 		if (!peer) {
 			/* We checked our list and didn't find one.  It's unlikely, but possible, 




More information about the asterisk-commits mailing list