mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-03 12:25:35 +00:00
Merged revisions 149199 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r149199 | tilghman | 2008-10-14 17:38:06 -0500 (Tue, 14 Oct 2008) | 8 lines Add additional memory debugging to several core APIs, and fix several memory leaks found with these changes. (Closes issue #13505, closes issue #13543) Reported by: mav3rick, triccyx Patches: 20081001__bug13505.diff.txt uploaded by Corydon76 (license 14) Tested by: mav3rick, triccyx ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@149202 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -31,13 +31,21 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
#include "asterisk/strings.h"
|
||||
#include "asterisk/utils.h"
|
||||
|
||||
#ifdef MALLOC_DEBUG
|
||||
struct ast_var_t *_ast_var_assign(const char *name, const char *value, const char *file, int lineno, const char *function)
|
||||
#else
|
||||
struct ast_var_t *ast_var_assign(const char *name, const char *value)
|
||||
#endif
|
||||
{
|
||||
struct ast_var_t *var;
|
||||
int name_len = strlen(name) + 1;
|
||||
int value_len = strlen(value) + 1;
|
||||
|
||||
#ifdef MALLOC_DEBUG
|
||||
if (!(var = __ast_calloc(sizeof(*var) + name_len + value_len, sizeof(char), file, lineno, function))) {
|
||||
#else
|
||||
if (!(var = ast_calloc(sizeof(*var) + name_len + value_len, sizeof(char)))) {
|
||||
#endif
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user