diff options
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | grammar/rainerscript.c | 5 |
2 files changed, 5 insertions, 1 deletions
@@ -11,6 +11,7 @@ Version 7.4.5 [v7.4-stable] 2013-09-?? - now requires libestr 0.1.8 as early versions had a nasty bug in string comparisons - omelasticsearch: add failed.httprequests stats counter +- bugfix: segfault if re_extract() function was used and no match found - bugfix: omelasticsearch: correct failed.http stats counter - bugfix: omelasticsearch: did not correctly initialize stats counters - bugfix: omelasticsearch: failed.es counter was only maintained in bulk mode diff --git a/grammar/rainerscript.c b/grammar/rainerscript.c index f4833679..f9c5047c 100644 --- a/grammar/rainerscript.c +++ b/grammar/rainerscript.c @@ -1315,7 +1315,10 @@ finalize_it: if(bHadNoMatch) { cnfexprEval(func->expr[4], &r[4], usrptr); estr = var2String(&r[4], &bMustFree); - if(r[4].datatype == 'S') es_deleteStr(r[4].d.estr); + /* Note that we do NOT free the string that was returned/created + * for r[4]. We pass it to the caller, which in turn frees it. + * This saves us doing one unnecessary memory alloc & write. + */ } ret->datatype = 'S'; ret->d.estr = estr; |