aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_iax2.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-07-27 04:25:41 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-07-27 04:25:41 +0000
commit62a60d6cd60e5cc96181345fbd4e706bbd7ace52 (patch)
tree4fd03baef34facc7963cfb6436d666467ce7bdb4 /channels/chan_iax2.c
parentd50957552268bf92841436956c99020e8d2e19fe (diff)
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. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@38328 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_iax2.c')
-rw-r--r--channels/chan_iax2.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index 576ca6351..d1e33f408 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -663,6 +663,15 @@ static struct iax2_peer *realtime_peer(const char *peername, struct sockaddr_in
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 @@ static void register_peer_exten(struct iax2_peer *peer, int onoff)
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);
}