[asterisk-commits] mjordan: branch 1.8 r370273 - /branches/1.8/main/cel.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jul 19 17:00:17 CDT 2012


Author: mjordan
Date: Thu Jul 19 17:00:14 2012
New Revision: 370273

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=370273
Log:
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

Modified:
    branches/1.8/main/cel.c

Modified: branches/1.8/main/cel.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/cel.c?view=diff&rev=370273&r1=370272&r2=370273
==============================================================================
--- branches/1.8/main/cel.c (original)
+++ branches/1.8/main/cel.c Thu Jul 19 17:00:14 2012
@@ -395,7 +395,7 @@
  */
 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)




More information about the asterisk-commits mailing list