diff options
author | Jonathan Rose <jrose@digium.com> | 2012-10-22 20:19:51 +0000 |
---|---|---|
committer | Jonathan Rose <jrose@digium.com> | 2012-10-22 20:19:51 +0000 |
commit | 3d540ef218a8d0a9a734bb7f84c9de428962ac1d (patch) | |
tree | 702e26e9949bab7045c7676a83c93adae221d07a /main/app.c | |
parent | 31f1881ceb6bf1b88b54220057e1ed057a2135af (diff) |
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)
........
Merged revisions 375299 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 375300 from http://svn.asterisk.org/svn/asterisk/branches/10
........
Merged revisions 375301 from http://svn.asterisk.org/svn/asterisk/branches/11
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375311 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/app.c')
-rw-r--r-- | main/app.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/main/app.c b/main/app.c index e3a5f02c3..208db4b83 100644 --- a/main/app.c +++ b/main/app.c @@ -1562,6 +1562,7 @@ int ast_app_group_match_get_count(const char *groupmatch, const char *category) if (!ast_strlen_zero(category) && regcomp(®exbuf_category, category, REG_EXTENDED | REG_NOSUB)) { ast_log(LOG_ERROR, "Regex compile failed on: %s\n", category); + regfree(®exbuf_group); return 0; } |