diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2013-10-25 13:59:12 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2013-10-25 13:59:12 +0200 |
commit | 171def31f9630fc8bc47e5fc3a562d19111ca546 (patch) | |
tree | e9ac6204e71cad3dc1fe2b27eeb3d7b769205813 | |
parent | fbd9db49031d2e3d0cab98934ced3130611f03cb (diff) | |
download | rsyslog-171def31f9630fc8bc47e5fc3a562d19111ca546.tar.gz rsyslog-171def31f9630fc8bc47e5fc3a562d19111ca546.tar.bz2 rsyslog-171def31f9630fc8bc47e5fc3a562d19111ca546.zip |
bugfix: memleak in re_extract() function
Thanks to Pavel Levshin for reporting this problem.
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | grammar/rainerscript.c | 3 |
2 files changed, 4 insertions, 1 deletions
@@ -1,5 +1,7 @@ --------------------------------------------------------------------------- Version 7.4.6 [v7.4-stable] 2013-11-?? +- bugfix: memleak in re_extract() function + Thanks to Pavel Levshin for reporting this problem. - bugfix: memory leak in omhiredis Thanks to Pavel Levshin for the fix - bugfix: segfault if variable was assigned to non-container subtree 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); |