summaryrefslogtreecommitdiff
path: root/main/logger.c
diff options
context:
space:
mode:
authorKevin Harwell <kharwell@digium.com>2013-09-20 14:26:44 +0000
committerKevin Harwell <kharwell@digium.com>2013-09-20 14:26:44 +0000
commit2d091df5204dece66a1a08779dc97965982da984 (patch)
tree2b5b4ae1dabeabc57c34015833d9e6d40a8d1cda /main/logger.c
parentcf9272c05c36a9e13b67c596fa5bc9df16de0c1b (diff)
Fix memory leak in logger.
Fixed a memory leak discovered in the logger where a temporary string buffer was not being freed. (closes issue ASTERISK-22540) Reported by: John Hardin ........ Merged revisions 399513 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 399514 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399515 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/logger.c')
-rw-r--r--main/logger.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/main/logger.c b/main/logger.c
index 112456816..a6b25cd1b 100644
--- a/main/logger.c
+++ b/main/logger.c
@@ -1632,6 +1632,7 @@ void __ast_verbose_ap(const char *file, int line, const char *func, int level, s
res = ast_str_set_va(&buf, 0, fmt, ap);
/* If the build failed then we can drop this allocated message */
if (res == AST_DYNSTR_BUILD_FAILED) {
+ ast_free(buf);
return;
}
@@ -1659,6 +1660,7 @@ void __ast_verbose_ap(const char *file, int line, const char *func, int level, s
} while (p && *p);
ast_log_callid(__LOG_VERBOSE, file, line, func, callid, "%s", ast_str_buffer(prefixed));
+ ast_free(buf);
}
void __ast_verbose(const char *file, int line, const char *func, int level, const char *fmt, ...)