From 09dd5c92bb343b7dc9c93d3eff57cc004d57adc7 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 9 Oct 2008 16:02:30 +0200 Subject: fixed memory leaks - a big one in syslogd.c, which caused messages not to be freed when compiled for single-threading mode - a small one in the file output handler, outchannels, when a size-reached action was to be executed --- omfile.c | 2 ++ syslogd.c | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/omfile.c b/omfile.c index db2ec3eb..6fcf45ba 100644 --- a/omfile.c +++ b/omfile.c @@ -287,6 +287,8 @@ int resolveFileSizeLimit(instanceData *pData) execProg(pCmd, 1, pParams); + free(pCmd); + pData->fd = open((char*) pData->f_fname, O_WRONLY|O_APPEND|O_CREAT|O_NOCTTY, pData->fCreateMode); diff --git a/syslogd.c b/syslogd.c index afcc3b92..98e7d7ba 100644 --- a/syslogd.c +++ b/syslogd.c @@ -2784,7 +2784,6 @@ static void *singleWorker() * rgerhards, 2005-10-24 */ #ifndef USE_PTHREADS -#define enqueueMsg(x) processMsg((x)) #else static void enqueueMsg(msg_t *pMsg) { @@ -3299,7 +3298,12 @@ logmsg(int pri, msg_t *pMsg, int flags) */ pMsg->msgFlags = flags; +#ifndef USE_PTHREADS + processMsg(pMsg); + MsgDestruct(pMsg); +#else /* ifdef USE_PTHREADS */ enqueueMsg(pMsg); +#endif } -- cgit From f35197f1c2136b5e043cdf4776f99b4854bfcc5c Mon Sep 17 00:00:00 2001 From: Federico Nunez Date: Thu, 9 Oct 2008 16:04:18 +0200 Subject: bugfix: memory leaks in rsyslogd, primarily in singlethread mode Thanks to Frederico Nunez for providing the fix. The actual patch was commited before this one - unfortunately I forgot to set the author correct when commiting it and then it was pushed to the online repository. Sorry for this ;) Signed-off-by: Rainer Gerhards --- ChangeLog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ChangeLog b/ChangeLog index 730f65bb..ec115b0e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ --------------------------------------------------------------------------- Version 2.0.6 V2-STABLE (rgerhards), 2008-??-?? +- bugfix: memory leaks in rsyslogd, primarily in singlethread mode + Thanks to Frederico Nunez for providing the fix - bugfix: copy&paste error lead to dangling if - this caused a very minor issue with re-formatting a RFC3164 date when the message was invalidly formatted and had a colon immediately after the date. This was in the -- cgit