diff options
-rw-r--r-- | plugins/imudp/imudp.c | 10 | ||||
-rw-r--r-- | queue.c | 1 |
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 @@ -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); } |