summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-01-08 08:12:44 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-01-08 08:12:44 +0000
commitc44de2807a899521c8542321d91e3074f3c40086 (patch)
treee45a959a2f68d9cedffc30b69443bd19d1b0a399
parent4a50211fc1334513013da769174b74a656bfeae3 (diff)
downloadrsyslog-c44de2807a899521c8542321d91e3074f3c40086.tar.gz
rsyslog-c44de2807a899521c8542321d91e3074f3c40086.tar.xz
rsyslog-c44de2807a899521c8542321d91e3074f3c40086.zip
fixed some memory leaks in new code -- thanks to varmojfekoj for the patch
-rw-r--r--plugins/imudp/imudp.c10
-rw-r--r--queue.c1
2 files changed, 7 insertions, 4 deletions
diff --git a/plugins/imudp/imudp.c b/plugins/imudp/imudp.c
index 127ec2fd..0251a51a 100644
--- a/plugins/imudp/imudp.c
+++ b/plugins/imudp/imudp.c
@@ -222,13 +222,13 @@ BEGINwillRun
CODESTARTwillRun
PrintAllowedSenders(1); /* UDP */
+ /* if we could not set up any listners, there is no point in running... */
+ if(udpLstnSocks == NULL)
+ ABORT_FINALIZE(RS_RET_NO_RUN);
+
if((pRcvBuf = malloc(MAXLINE * sizeof(char))) == NULL) {
ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY);
}
-
- /* if we could not set up any listners, there is no point in running... */
- if(udpLstnSocks == NULL)
- iRet = RS_RET_NO_RUN;
finalize_it:
ENDwillRun
@@ -242,6 +242,8 @@ CODESTARTafterRun
}
if(udpLstnSocks != NULL)
closeUDPListenSockets(udpLstnSocks);
+ if(pRcvBuf != NULL)
+ free(pRcvBuf);
ENDafterRun
diff --git a/queue.c b/queue.c
index bd7aace1..29b5e43e 100644
--- a/queue.c
+++ b/queue.c
@@ -741,6 +741,7 @@ rsRetVal queueDestruct(queue_t *pThis)
for(i = 0 ; i < pThis->iNumWorkerThreads ; ++i) {
pthread_join(pThis->pWorkerThreads[i], NULL);
}
+ free(pThis->pWorkerThreads);
dbgprintf("Worker threads for queue 0x%lx terminated.\n", (unsigned long) pThis);
}