summaryrefslogtreecommitdiffstats
path: root/grammar
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2013-10-18 07:02:47 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2013-10-18 07:02:47 +0200
commit9c3b9b9fc44bc6a5b2dc51e8c2f4a31c8c02881a (patch)
tree87d8752b32b03f30b2825b67e5eff4e4cc62402b /grammar
parentd7b01b224a57e2b96cb992e67ee51306474685ec (diff)
parentdc1f81addfd428fca2c8115ebbfdb2e8a26d8375 (diff)
downloadrsyslog-9c3b9b9fc44bc6a5b2dc51e8c2f4a31c8c02881a.tar.gz
rsyslog-9c3b9b9fc44bc6a5b2dc51e8c2f4a31c8c02881a.tar.bz2
rsyslog-9c3b9b9fc44bc6a5b2dc51e8c2f4a31c8c02881a.zip
Merge branch 'v7-stable'
Diffstat (limited to 'grammar')
-rw-r--r--grammar/rainerscript.c5
1 files changed, 4 insertions, 1 deletions
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;