summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2013-10-25 17:01:42 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2013-10-25 17:01:42 +0200
commit5b9a6992f73bbbba847402946443b001f8b639df (patch)
treeb7be97348b2512191da070dd5f06db61f35bb0f3
parentbf95d5f034221fbc49904c30774f4ae269d4df68 (diff)
downloadrsyslog-5b9a6992f73bbbba847402946443b001f8b639df.tar.gz
rsyslog-5b9a6992f73bbbba847402946443b001f8b639df.tar.bz2
rsyslog-5b9a6992f73bbbba847402946443b001f8b639df.zip
bugfix: memory leak in strlen() RainerScript function
Thanks to Gregoire Seux for reportig this bug. closes: http://bugzilla.adiscon.com/show_bug.cgi?id=486
-rw-r--r--ChangeLog3
-rw-r--r--grammar/rainerscript.c1
2 files changed, 4 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index ef29644e..511c66b1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
---------------------------------------------------------------------------
Version 7.4.6 [v7.4-stable] 2013-11-??
+- bugfix: memory leak in strlen() RainerScript function
+ Thanks to Gregoire Seux for reportig this bug.
+ closes: http://bugzilla.adiscon.com/show_bug.cgi?id=486
- bugfix: buffer overrun if re_extract function was called for submatch 50
Thanks to Pavel Levshin for reporting the problem and its location.
- bugfix: memleak in re_extract() function
diff --git a/grammar/rainerscript.c b/grammar/rainerscript.c
index b86f7c30..986d2802 100644
--- a/grammar/rainerscript.c
+++ b/grammar/rainerscript.c
@@ -1359,6 +1359,7 @@ doFuncCall(struct cnffunc *func, struct var *ret, void* usrptr)
estr = var2String(&r[0], &bMustFree);
ret->d.n = es_strlen(estr);
if(bMustFree) es_deleteStr(estr);
+ if(r[0].datatype == 'S') es_deleteStr(r[0].d.estr);
}
ret->datatype = 'N';
break;