From c44de2807a899521c8542321d91e3074f3c40086 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Tue, 8 Jan 2008 08:12:44 +0000 Subject: fixed some memory leaks in new code -- thanks to varmojfekoj for the patch --- plugins/imudp/imudp.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'plugins/imudp') 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 -- cgit