From 5b9a6992f73bbbba847402946443b001f8b639df Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 25 Oct 2013 17:01:42 +0200 Subject: 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 --- ChangeLog | 3 +++ grammar/rainerscript.c | 1 + 2 files changed, 4 insertions(+) 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; -- cgit v1.2.3