summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2012-10-15 18:46:08 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2012-10-15 18:46:08 +0200
commit9602d83730803899965e0bad780bc4b5a09adae2 (patch)
tree3a264d129868e72ddeab215c0f8c2c4bd3516b7d
parentb6e6cfeff8cdf4c8e2da1e623b66698f4a51856f (diff)
downloadrsyslog-9602d83730803899965e0bad780bc4b5a09adae2.tar.gz
rsyslog-9602d83730803899965e0bad780bc4b5a09adae2.tar.bz2
rsyslog-9602d83730803899965e0bad780bc4b5a09adae2.zip
fix: memory leak in linux-like ratelimiter
-rw-r--r--runtime/ratelimit.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/ratelimit.c b/runtime/ratelimit.c
index ccfcfdd2..4b618fb5 100644
--- a/runtime/ratelimit.c
+++ b/runtime/ratelimit.c
@@ -203,8 +203,10 @@ ratelimitMsg(ratelimit_t *ratelimit, msg_t *pMsg, msg_t **ppRepMsg)
*ppRepMsg = NULL;
if(ratelimit->interval) {
- if(withinRatelimit(ratelimit, pMsg->ttGenTime) == 0)
+ if(withinRatelimit(ratelimit, pMsg->ttGenTime) == 0) {
+ msgDestruct(&pMsg);
ABORT_FINALIZE(RS_RET_DISCARDMSG);
+ }
}
if(ratelimit->bReduceRepeatMsgs) {
CHKiRet(doLastMessageRepeatedNTimes(ratelimit, pMsg, ppRepMsg));