mirror of
https://github.com/rsyslog/rsyslog.git
synced 2025-12-19 10:20:42 +01:00
fixed some memory leaks in new code -- thanks to varmojfekoj for the patch
This commit is contained in:
parent
4a50211fc1
commit
c44de2807a
@ -222,13 +222,13 @@ BEGINwillRun
|
|||||||
CODESTARTwillRun
|
CODESTARTwillRun
|
||||||
PrintAllowedSenders(1); /* UDP */
|
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) {
|
if((pRcvBuf = malloc(MAXLINE * sizeof(char))) == NULL) {
|
||||||
ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY);
|
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:
|
finalize_it:
|
||||||
ENDwillRun
|
ENDwillRun
|
||||||
|
|
||||||
@ -242,6 +242,8 @@ CODESTARTafterRun
|
|||||||
}
|
}
|
||||||
if(udpLstnSocks != NULL)
|
if(udpLstnSocks != NULL)
|
||||||
closeUDPListenSockets(udpLstnSocks);
|
closeUDPListenSockets(udpLstnSocks);
|
||||||
|
if(pRcvBuf != NULL)
|
||||||
|
free(pRcvBuf);
|
||||||
ENDafterRun
|
ENDafterRun
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
1
queue.c
1
queue.c
@ -741,6 +741,7 @@ rsRetVal queueDestruct(queue_t *pThis)
|
|||||||
for(i = 0 ; i < pThis->iNumWorkerThreads ; ++i) {
|
for(i = 0 ; i < pThis->iNumWorkerThreads ; ++i) {
|
||||||
pthread_join(pThis->pWorkerThreads[i], NULL);
|
pthread_join(pThis->pWorkerThreads[i], NULL);
|
||||||
}
|
}
|
||||||
|
free(pThis->pWorkerThreads);
|
||||||
dbgprintf("Worker threads for queue 0x%lx terminated.\n", (unsigned long) pThis);
|
dbgprintf("Worker threads for queue 0x%lx terminated.\n", (unsigned long) pThis);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user