[asterisk-commits] mjordan: branch 10 r375797 - /branches/10/res/res_fax.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Nov 3 21:42:47 CDT 2012


Author: mjordan
Date: Sat Nov  3 21:42:43 2012
New Revision: 375797

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=375797
Log:
Only deref a reserved gateway session if we actually reserved one

Its perfectly acceptable to have a gateway session unreserved when we go to
first allocate one.  Unreffing the reserved gateway session - when its NULL -
will result in an assertion error.

This problem was caught by the Asterisk Test Suite (once we had enough of the
debugging flags enabled)

Modified:
    branches/10/res/res_fax.c

Modified: branches/10/res/res_fax.c
URL: http://svnview.digium.com/svn/asterisk/branches/10/res/res_fax.c?view=diff&rev=375797&r1=375796&r2=375797
==============================================================================
--- branches/10/res/res_fax.c (original)
+++ branches/10/res/res_fax.c Sat Nov  3 21:42:43 2012
@@ -2549,7 +2549,9 @@
 	}
 	/* release the reference for the reserved session and replace it with
 	 * the real session */
-	ao2_ref(gateway->s, -1);
+	if (gateway->s) {
+		ao2_ref(gateway->s, -1);
+	}
 	gateway->s = s;
 	gateway->token = NULL;
 




More information about the asterisk-commits mailing list