summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2011-02-25 11:05:57 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2011-02-25 11:05:57 +0100
commitdfa88369d4ca4290db56b843f9eabdae1bfe0fd5 (patch)
tree800c102df822eacd8f1f5a651b71008e800eec67 /runtime
parent237df37a86479e1f60e73bdcd1da15ccc319fa15 (diff)
downloadrsyslog-dfa88369d4ca4290db56b843f9eabdae1bfe0fd5.tar.gz
rsyslog-dfa88369d4ca4290db56b843f9eabdae1bfe0fd5.tar.xz
rsyslog-dfa88369d4ca4290db56b843f9eabdae1bfe0fd5.zip
bugfix: memory leak when $RepeatedMsgReduction on was used
bug tracker: http://bugzilla.adiscon.com/show_bug.cgi?id=225
Diffstat (limited to 'runtime')
-rw-r--r--runtime/queue.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/runtime/queue.c b/runtime/queue.c
index c2806ca1..ae08c859 100644
--- a/runtime/queue.c
+++ b/runtime/queue.c
@@ -839,6 +839,7 @@ static rsRetVal qAddDirect(qqueue_t *pThis, void* pUsr)
{
batch_t singleBatch;
batch_obj_t batchObj;
+ int i;
DEFiRet;
//TODO: init batchObj (states _OK and new fields -- CHECK)
@@ -860,6 +861,10 @@ static rsRetVal qAddDirect(qqueue_t *pThis, void* pUsr)
singleBatch.nElem = 1; /* there always is only one in direct mode */
singleBatch.pElem = &batchObj;
iRet = pThis->pConsumer(pThis->pUsr, &singleBatch, &pThis->bShutdownImmediate);
+ /* delete the batch string params: TODO: create its own "class" for this */
+ for(i = 0 ; i < CONF_OMOD_NUMSTRINGS_MAXSIZE ; ++i) {
+ free(batchObj.staticActStrings[i]);
+ }
objDestruct(pUsr);
RETiRet;