fixed some memory leaks in new code -- thanks to varmojfekoj for the patch

This commit is contained in:
Rainer Gerhards 2008-01-08 08:12:44 +00:00
parent 4a50211fc1
commit c44de2807a
2 changed files with 7 additions and 4 deletions

View File

@ -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

View File

@ -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);
}