From 7e7a32a4ed051bbad971705dee155864254a85ad Mon Sep 17 00:00:00 2001 From: jpeeler Date: Wed, 11 Mar 2009 04:06:44 +0000 Subject: Fix malloc debug macros to work properly with h323. The main problem here was that cstdlib was undefining free thereby causing the proper debug macros to not be used. ast_h323.cxx has been changed to call ast_free instead to avoid the issue. A few other issues were addressed: - There were a few instances of functions improperly passing ast_free instead of ast_free_ptr. - Some clean up was done to avoid the debug macros intentionally being redefined. (copied below from Kevin's commit, appreciate the help) - disable astmm.h from doing anything when STANDALONE is defined, which is used by the tools in the utils/ directory that use parts of Asterisk header files in hackish ways; also ensure that utils/extconf.c and utils/conf2ael.c are compiled with STANDALONE defined. (closes issue #13593) Reported by: pj git-svn-id: http://svn.digium.com/svn/asterisk/trunk@181135 f38db490-d61c-443f-a65b-d21fe96a405b --- channels/h323/ast_h323.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'channels/h323') diff --git a/channels/h323/ast_h323.cxx b/channels/h323/ast_h323.cxx index 425961435..0c31569f3 100644 --- a/channels/h323/ast_h323.cxx +++ b/channels/h323/ast_h323.cxx @@ -140,7 +140,7 @@ int PAsteriskLog::Buffer::underflow() int PAsteriskLog::Buffer::sync() { - char *str = strdup(string); + char *str = ast_strdup(string); char *s, *s1; char c; @@ -156,7 +156,7 @@ int PAsteriskLog::Buffer::sync() ast_verbose("%s", s); *s1 = c; } - free(str); + ast_free(str); string = PString(); char *base = string.GetPointer(2000); @@ -2141,7 +2141,7 @@ MyH323_ExternalRTPChannel::MyH323_ExternalRTPChannel(MyH323Connection & connecti /* tell the H.323 stack */ SetExternalAddress(H323TransportAddress(localIpAddr, localPort), H323TransportAddress(localIpAddr, localPort + 1)); /* clean up allocated memory */ - free(info); + ast_free(info); } /* Get the payload code */ @@ -2388,7 +2388,7 @@ int h323_set_alias(struct oh323_alias *alias) endPoint->SetGateway(); } if (prefix) - free(prefix); + ast_free(prefix); } return 0; } -- cgit v1.2.3