[svn-commits] jrose: branch 1.8 r375299 - /branches/1.8/main/app.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Oct 22 14:47:50 CDT 2012


Author: jrose
Date: Mon Oct 22 14:47:47 2012
New Revision: 375299

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=375299
Log:
core: Fix a memory leak in app.c from an early return

ast_app_group_match_get_count allocates memory with the regcomp
function and we previously forgot to free it when bailing out
due to a regex compilation failure against category.

(closes issue AST-1018)
Reported by: Guenther Kelleter
Patches:
	regcomp_memleak.diff uploaded by Guenther Kelleter (license 6372)

Modified:
    branches/1.8/main/app.c

Modified: branches/1.8/main/app.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/app.c?view=diff&rev=375299&r1=375298&r2=375299
==============================================================================
--- branches/1.8/main/app.c (original)
+++ branches/1.8/main/app.c Mon Oct 22 14:47:47 2012
@@ -1179,6 +1179,7 @@
 
 	if (!ast_strlen_zero(category) && regcomp(&regexbuf_category, category, REG_EXTENDED | REG_NOSUB)) {
 		ast_log(LOG_ERROR, "Regex compile failed on: %s\n", category);
+		regfree(&regexbuf_group);
 		return 0;
 	}
 




More information about the svn-commits mailing list