aboutsummaryrefslogtreecommitdiffstats
path: root/channel.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-07-27 01:49:57 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-07-27 01:49:57 +0000
commit2328f30da7a94bea19ab02b0fdb8f5ebf79d3f52 (patch)
treeb18f2f1e95153d05ed69d99381e8f9f296cbdad1 /channel.c
parent3336dbf9857f0db05c25391089b5f2dec6c36135 (diff)
fix crashes with MALLOC_DEBUG enabled that were a result of my recent thread
storage changes (fixes issue #7595) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38286 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channel.c')
-rw-r--r--channel.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/channel.c b/channel.c
index 2c51b6950..5ee36290b 100644
--- a/channel.c
+++ b/channel.c
@@ -160,6 +160,14 @@ const struct ast_cause {
{ AST_CAUSE_INTERWORKING, "INTERWORKING", "Interworking, unspecified" },
};
+#ifdef __AST_DEBUG_MALLOC
+static void FREE(void *ptr)
+{
+ free(ptr);
+}
+#else
+#define FREE free
+#endif
struct ast_variable *ast_channeltype_list(void)
{
@@ -487,7 +495,7 @@ int ast_str2cause(const char *name)
static void state2str_buf_key_create(void)
{
- pthread_key_create(&state2str_buf_key, free);
+ pthread_key_create(&state2str_buf_key, FREE);
}
/*! \brief Gives the string form of a given channel state */