[asterisk-commits] dvossel: branch 1.6.2 r319144 - /branches/1.6.2/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon May 16 10:56:20 CDT 2011


Author: dvossel
Date: Mon May 16 10:56:16 2011
New Revision: 319144

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=319144
Log:
Fixes issue with peer ref-counting during handle_request_subscribe.

Modified:
    branches/1.6.2/channels/chan_sip.c

Modified: branches/1.6.2/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/channels/chan_sip.c?view=diff&rev=319144&r1=319143&r2=319144
==============================================================================
--- branches/1.6.2/channels/chan_sip.c (original)
+++ branches/1.6.2/channels/chan_sip.c Mon May 16 10:56:16 2011
@@ -22037,7 +22037,7 @@
 		const char *unknown_acceptheader = NULL;
 
 		if (authpeer)	/* We do not need the authpeer any more */
-			unref_peer(authpeer, "unref_peer, from handle_request_subscribe (authpeer 2)");
+			authpeer = unref_peer(authpeer, "unref_peer, from handle_request_subscribe (authpeer 2)");
 
 		/* Header from Xten Eye-beam Accept: multipart/related, application/rlmi+xml, application/pidf+xml, application/xpidf+xml */
 
@@ -22168,9 +22168,10 @@
 		return 0;
 	}
 
-	/* At this point, if we have an authpeer (which we have to have to get here) we should unref
-	 * it since if we have actually used it, we have reffed it when p->relatedpeer was set. */
-	authpeer = unref_peer(authpeer, "unref pointer into (*authpeer)");
+	/* At this point, if we have an authpeer we should unref it. */
+	if (authpeer) {
+		authpeer = unref_peer(authpeer, "unref pointer into (*authpeer)");
+	}
 
 	/* Add subscription for extension state from the PBX core */
 	if (p->subscribed != MWI_NOTIFICATION && !resubscribe) {




More information about the asterisk-commits mailing list