diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2013-10-18 07:02:47 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2013-10-18 07:02:47 +0200 |
commit | 9c3b9b9fc44bc6a5b2dc51e8c2f4a31c8c02881a (patch) | |
tree | 87d8752b32b03f30b2825b67e5eff4e4cc62402b | |
parent | d7b01b224a57e2b96cb992e67ee51306474685ec (diff) | |
parent | dc1f81addfd428fca2c8115ebbfdb2e8a26d8375 (diff) | |
download | rsyslog-9c3b9b9fc44bc6a5b2dc51e8c2f4a31c8c02881a.tar.gz rsyslog-9c3b9b9fc44bc6a5b2dc51e8c2f4a31c8c02881a.tar.bz2 rsyslog-9c3b9b9fc44bc6a5b2dc51e8c2f4a31c8c02881a.zip |
Merge branch 'v7-stable'
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | grammar/rainerscript.c | 5 |
2 files changed, 5 insertions, 1 deletions
@@ -165,6 +165,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 328ec7fc..6119107c 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; |