aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-07-27 01:58:41 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-07-27 01:58:41 +0000
commit625c87d9440b8e139bee36efe7112038c664253a (patch)
tree7558944eb2bf862b4202ea6347ce0fe4b0aa4b6c /channels
parent3ba79680fbd7fa5b4ff03761ef79389d9de7c089 (diff)
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) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@38288 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 7b67bebd0..d9ce9afdd 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -953,6 +953,15 @@ static const struct ast_channel_tech sip_tech = {
.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 @@ static void register_peer_exten(struct sip_peer *peer, int onoff)
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);
}