From: Matthew Jordan Date: Thu, 19 Jul 2012 22:01:32 +0000 (+0000) Subject: Fix compilation error when MALLOC_DEBUG is enabled X-Git-Tag: 10.8.0-rc1~3^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d77a16a53dbfca4757b6541b569e316dea1fe053;p=thirdparty%2Fasterisk.git Fix compilation error when MALLOC_DEBUG is enabled To fix a memory leak in CEL, a channel datastore was introduced whose destruction function pointer was pointed to the ast_free macro. Without MALLOC_DEBUG enabled this compiles as fine, as ast_free is defined as free. With MALLOC_DEBUG enabled, however, ast_free takes on a definition from a different place then utils.h, and became undefined. This patch resolves this by using a reference to ast_free_ptr. When MALLOC_DEBUG is enabled, this calls ast_free; when MALLOC_DEBUG is not enabled, this is defined to be ast_free, which is defined to be free. (issue AST-916) Reported by: Thomas Arimont ........ Merged revisions 370273 from http://svn.asterisk.org/svn/asterisk/branches/1.8 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@370274 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/cel.c b/main/cel.c index bb8723bfcf..e9d05901a5 100644 --- a/main/cel.c +++ b/main/cel.c @@ -395,7 +395,7 @@ void ast_cel_check_retire_linkedid(struct ast_channel *chan) */ static const struct ast_datastore_info fabricated_channel_datastore = { .type = "CEL fabricated channel", - .destroy = ast_free, + .destroy = ast_free_ptr, }; struct ast_channel *ast_cel_fabricate_channel_from_event(const struct ast_event *event)