summaryrefslogtreecommitdiffstats
path: root/plugins/imudp/imudp.c
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 /plugins/imudp/imudp.c
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
Diffstat (limited to 'plugins/imudp/imudp.c')
-rw-r--r--plugins/imudp/imudp.c10
1 files changed, 6 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