fix crashes with MALLOC_DEBUG enabled that were a result of my recent thread

storage changes (fixes issue #7595)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38286 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2006-07-27 01:49:57 +00:00
parent a43a350c3e
commit 7b8d8c9bb5
3 changed files with 29 additions and 3 deletions

11
cli.c
View File

@@ -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, ...)