[asterisk-commits] kharwell: branch 11 r399513 - /branches/11/main/logger.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Sep 20 09:23:33 CDT 2013


Author: kharwell
Date: Fri Sep 20 09:23:30 2013
New Revision: 399513

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=399513
Log:
Memory leak in logger.

Fixed a memory leak discovered in the logger where a temporary string buffer
was not being freed.

Reported by: John Hardin

Modified:
    branches/11/main/logger.c

Modified: branches/11/main/logger.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/main/logger.c?view=diff&rev=399513&r1=399512&r2=399513
==============================================================================
--- branches/11/main/logger.c (original)
+++ branches/11/main/logger.c Fri Sep 20 09:23:30 2013
@@ -1811,6 +1811,7 @@
 	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;
 	}
 
@@ -1838,6 +1839,7 @@
 	} 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, ...)




More information about the asterisk-commits mailing list