summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2011-03-14 12:17:27 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2011-03-14 12:17:27 +0100
commit00771a760bf2603276be906ad168ed50c90bf412 (patch)
tree67b694849288ef797404bdabf423691eaf597389 /plugins
parent85358a2df39f662d36f735b77be932f7995f3e75 (diff)
downloadrsyslog-00771a760bf2603276be906ad168ed50c90bf412.tar.gz
rsyslog-00771a760bf2603276be906ad168ed50c90bf412.tar.xz
rsyslog-00771a760bf2603276be906ad168ed50c90bf412.zip
fixing cosmetic memory leak in imdiag, imfile
This had no real consequences, as it happend exactly once during the runtime, so the OS cleaned up. However, it broke the valgrind testbench.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/imdiag/imdiag.c3
-rw-r--r--plugins/imfile/imfile.c8
2 files changed, 11 insertions, 0 deletions
diff --git a/plugins/imdiag/imdiag.c b/plugins/imdiag/imdiag.c
index 0a69ee43..404cebc7 100644
--- a/plugins/imdiag/imdiag.c
+++ b/plugins/imdiag/imdiag.c
@@ -433,6 +433,9 @@ CODESTARTmodExit
net.DestructPermittedPeers(&pPermPeersRoot);
}
+ /* free some globals to keep valgrind happy */
+ free(pszInputName);
+
/* release objects we used */
objRelease(net, LM_NET_FILENAME);
objRelease(netstrm, LM_NETSTRMS_FILENAME);
diff --git a/plugins/imfile/imfile.c b/plugins/imfile/imfile.c
index acb58dad..cac3a55d 100644
--- a/plugins/imfile/imfile.c
+++ b/plugins/imfile/imfile.c
@@ -331,6 +331,11 @@ ENDrunInput
*/
BEGINwillRun
CODESTARTwillRun
+ /* free config variables we do no longer needed */
+ free(pszFileName);
+ free(pszFileTag);
+ free(pszStateFile);
+
if(iFilPtr == 0) {
errmsg.LogError(0, RS_RET_NO_RUN, "No files configured to be monitored");
ABORT_FINALIZE(RS_RET_NO_RUN);
@@ -398,6 +403,9 @@ CODESTARTafterRun
persistStrmState(&files[i]);
strm.Destruct(&(files[i].pStrm));
}
+ free(files[i].pszFileName);
+ free(files[i].pszTag);
+ free(files[i].pszStateFile);
}
if(pInputName != NULL)