summaryrefslogtreecommitdiffstats
path: root/action.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2013-11-06 14:30:04 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2013-11-06 14:30:04 +0100
commite99c01e58ec6f21e8be2113485fb61f19345e57d (patch)
treecd6b31521b12b6d3bcbed62c339fc70228ea1863 /action.c
parent21d85b3b67a58fed532e377b2a3e761f9b1e77a0 (diff)
downloadrsyslog-e99c01e58ec6f21e8be2113485fb61f19345e57d.tar.gz
rsyslog-e99c01e58ec6f21e8be2113485fb61f19345e57d.tar.bz2
rsyslog-e99c01e58ec6f21e8be2113485fb61f19345e57d.zip
fix previously introduced memleak with template strings
Diffstat (limited to 'action.c')
-rw-r--r--action.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/action.c b/action.c
index 6b7169ab..2941e0e6 100644
--- a/action.c
+++ b/action.c
@@ -1000,6 +1000,7 @@ actionFreeParams(action_t *pThis, wti_t *pWti)
{
actWrkrInfo_t *wrkrInfo;
actWrkrIParams_t *iparamCurr, *iparamDel;
+ int j;
wrkrInfo = &(pWti->actWrkrInfo[pThis->iActionNbr]);
dbgprintf("DDDD: actionFreeParams: action %d, root %p\n", pThis->iActionNbr, wrkrInfo->iparamRoot);
@@ -1009,7 +1010,15 @@ actionFreeParams(action_t *pThis, wti_t *pWti)
releaseDoActionParams(pThis, pWti);
iparamDel = iparamCurr;
iparamCurr = iparamCurr->next;
- free(iparamDel); // TODO: memleak strings!
+ for(j = 0 ; j < CONF_OMOD_NUMSTRINGS_MAXSIZE ; ++j) {
+ /* TODO: we can save time by not freeing everything,
+ * but that's left for a later optimization.
+ */
+ free(iparamDel->staticActStrings[j]);
+ iparamDel->staticActStrings[j] = NULL;
+ iparamDel->staticLenStrings[j] = 0;
+ }
+ free(iparamDel);
}
wrkrInfo->iparamRoot = wrkrInfo->iparamLast = NULL;
}