From 9602d83730803899965e0bad780bc4b5a09adae2 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Mon, 15 Oct 2012 18:46:08 +0200 Subject: fix: memory leak in linux-like ratelimiter --- runtime/ratelimit.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)); -- cgit v1.2.3