From 2fb25c3aead43f2aff7c9913dc286e55baabfe9a Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Thu, 8 Sep 2011 22:27:40 +0000 Subject: [PATCH] Fix crash with res_fax when MALLOC_DEBUG and "core stop gracefully" are used. Asterisk crashes if MALLOC_DEBUG is enabled when res_fax tries to unregister its logger level. * Make ast_logger_unregister_level() use ast_free() instead of free(). When MALLOC_DEBUG is enabled, ast_free() does not degenerate into a call to free(). Therefore, if you allocated memory with a form of ast_malloc you must free it with ast_free. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@334953 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/logger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/logger.c b/main/logger.c index 0e0d2a0b33..017edca09a 100644 --- a/main/logger.c +++ b/main/logger.c @@ -1661,7 +1661,7 @@ void ast_logger_unregister_level(const char *name) global_logmask &= ~(1 << x); - free(levels[x]); + ast_free(levels[x]); levels[x] = NULL; AST_RWLIST_UNLOCK(&logchannels); -- 2.47.2