[asterisk-commits] russell: branch 1.2 r38288 - /branches/1.2/channels/chan_sip.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Jul 26 18:58:41 MST 2006


Author: russell
Date: Wed Jul 26 20:58:41 2006
New Revision: 38288

URL: http://svn.digium.com/view/asterisk?rev=38288&view=rev
Log:
fix a crash when MALLOC_DEBUG is enabled and the regexten is enabled. The crash
would occur when the extension got removed. (fixes issue #7484)

Modified:
    branches/1.2/channels/chan_sip.c

Modified: branches/1.2/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/channels/chan_sip.c?rev=38288&r1=38287&r2=38288&view=diff
==============================================================================
--- branches/1.2/channels/chan_sip.c (original)
+++ branches/1.2/channels/chan_sip.c Wed Jul 26 20:58:41 2006
@@ -953,6 +953,15 @@
 	.send_text = sip_sendtext,
 };
 
+#ifdef __AST_DEBUG_MALLOC
+static void FREE(void *ptr)
+{
+	free(ptr);
+}
+#else
+#define FREE free
+#endif
+
 /*!
   \brief Thread-safe random number generator
   \return a random number
@@ -1625,7 +1634,7 @@
 		stringp = multi;
 		while((ext = strsep(&stringp, "&"))) {
 			if (onoff)
-				ast_add_extension(regcontext, 1, ext, 1, NULL, NULL, "Noop", strdup(peer->name), free, channeltype);
+				ast_add_extension(regcontext, 1, ext, 1, NULL, NULL, "Noop", strdup(peer->name), FREE, channeltype);
 			else
 				ast_context_remove_extension(regcontext, ext, 1, NULL);
 		}



More information about the asterisk-commits mailing list