summaryrefslogtreecommitdiffstats
path: root/grammar
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2013-10-25 13:59:12 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2013-10-25 13:59:12 +0200
commit171def31f9630fc8bc47e5fc3a562d19111ca546 (patch)
treee9ac6204e71cad3dc1fe2b27eeb3d7b769205813 /grammar
parentfbd9db49031d2e3d0cab98934ced3130611f03cb (diff)
downloadrsyslog-171def31f9630fc8bc47e5fc3a562d19111ca546.tar.gz
rsyslog-171def31f9630fc8bc47e5fc3a562d19111ca546.tar.bz2
rsyslog-171def31f9630fc8bc47e5fc3a562d19111ca546.zip
bugfix: memleak in re_extract() function
Thanks to Pavel Levshin for reporting this problem.
Diffstat (limited to 'grammar')
-rw-r--r--grammar/rainerscript.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/grammar/rainerscript.c b/grammar/rainerscript.c
index 63bb6f67..9cacb4ae 100644
--- a/grammar/rainerscript.c
+++ b/grammar/rainerscript.c
@@ -1307,11 +1307,12 @@ doFunc_re_extract(struct cnffunc *func, struct var *ret, void* usrptr)
iLenBuf);
}
+finalize_it:
if(bMustFree) free(str);
if(r[0].datatype == 'S') es_deleteStr(r[0].d.estr);
if(r[2].datatype == 'S') es_deleteStr(r[2].d.estr);
if(r[3].datatype == 'S') es_deleteStr(r[3].d.estr);
-finalize_it:
+
if(bHadNoMatch) {
cnfexprEval(func->expr[4], &r[4], usrptr);
estr = var2String(&r[4], &bMustFree);