aboutsummaryrefslogtreecommitdiffstats
path: root/cli.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 /cli.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 'cli.c')
-rw-r--r--cli.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/cli.c b/cli.c
index 205ef7f7a..6afd56d5e 100644
--- a/cli.c
+++ b/cli.c
@@ -57,9 +57,18 @@ static pthread_once_t ast_cli_buf_once = PTHREAD_ONCE_INIT;
/*! \brief Initial buffer size for resulting strings in ast_cli() */
#define AST_CLI_MAXSTRLEN 256
+#ifdef __AST_DEBUG_MALLOC
+static void FREE(void *ptr)
+{
+ free(ptr);
+}
+#else
+#define FREE free
+#endif
+
static void ast_cli_buf_key_create(void)
{
- pthread_key_create(&ast_cli_buf_key, free);
+ pthread_key_create(&ast_cli_buf_key, FREE);
}
void ast_cli(int fd, char *fmt, ...)