[asterisk-commits] russell: branch 1.2 r38328 - /branches/1.2/channels/chan_iax2.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Jul 26 21:25:42 MST 2006


Author: russell
Date: Wed Jul 26 23:25:41 2006
New Revision: 38328

URL: http://svn.digium.com/view/asterisk?rev=38328&view=rev
Log:
Fix crash when using the "regexten" option with MALLOC_DEBUG enabled.  This was
not reported in the bug tracker but the same bug has been demonstrated in other
places in the code.

Modified:
    branches/1.2/channels/chan_iax2.c

Modified: branches/1.2/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/channels/chan_iax2.c?rev=38328&r1=38327&r2=38328&view=diff
==============================================================================
--- branches/1.2/channels/chan_iax2.c (original)
+++ branches/1.2/channels/chan_iax2.c Wed Jul 26 23:25:41 2006
@@ -663,6 +663,15 @@
 static void destroy_peer(struct iax2_peer *peer);
 static int ast_cli_netstats(int fd, int limit_fmt);
 
+#ifdef __AST_DEBUG_MALLOC
+static void FREE(void *ptr)
+{
+	free(ptr);
+}
+#else
+#define FREE free
+#endif
+
 static void iax_debug_output(const char *data)
 {
 	if (iaxdebug)
@@ -5627,7 +5636,7 @@
 		while((ext = strsep(&stringp, "&"))) {
 			if (onoff) {
 				if (!ast_exists_extension(NULL, regcontext, ext, 1, NULL))
-					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