diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2013-11-06 14:30:04 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2013-11-06 14:30:04 +0100 |
commit | e99c01e58ec6f21e8be2113485fb61f19345e57d (patch) | |
tree | cd6b31521b12b6d3bcbed62c339fc70228ea1863 /action.c | |
parent | 21d85b3b67a58fed532e377b2a3e761f9b1e77a0 (diff) | |
download | rsyslog-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.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -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; } |