diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2011-03-14 12:17:27 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2011-03-14 12:17:27 +0100 |
commit | 00771a760bf2603276be906ad168ed50c90bf412 (patch) | |
tree | 67b694849288ef797404bdabf423691eaf597389 | |
parent | 85358a2df39f662d36f735b77be932f7995f3e75 (diff) | |
download | rsyslog-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.
-rw-r--r-- | plugins/imdiag/imdiag.c | 3 | ||||
-rw-r--r-- | plugins/imfile/imfile.c | 8 | ||||
-rw-r--r-- | runtime/cfsysline.c | 3 |
3 files changed, 14 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) diff --git a/runtime/cfsysline.c b/runtime/cfsysline.c index 037e9f84..646ab39b 100644 --- a/runtime/cfsysline.c +++ b/runtime/cfsysline.c @@ -41,6 +41,7 @@ #include "obj.h" #include "errmsg.h" #include "srUtils.h" +#include "unicode-helper.h" /* static data */ @@ -511,6 +512,8 @@ static rsRetVal doGetWord(uchar **pp, rsRetVal (*pSetHdlr)(void*, uchar*), void CHKiRet(cstrConvSzStrAndDestruct(pStrB, &pNewVal, 0)); pStrB = NULL; + DBGPRINTF("doGetWord: get newval '%s' (len %d), hdlr %p\n", + pNewVal, (int) ustrlen(pNewVal), pSetHdlr); /* we got the word, now set it */ if(pSetHdlr == NULL) { /* we should set value directly to var */ |