diff options
author | varmojfekoj <theinric@redhat.com> | 2010-02-04 16:02:57 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2010-02-04 16:02:57 +0100 |
commit | 8c3ab2e26f1bae46ff34fc1d0a10a69c4db78127 (patch) | |
tree | fde5f05035166bb859f9be7319f70788b4edb8ef /runtime | |
parent | 7d098f14cba4f31dec7d92136183ebd0ccf7e1d0 (diff) | |
download | rsyslog-8c3ab2e26f1bae46ff34fc1d0a10a69c4db78127.tar.gz rsyslog-8c3ab2e26f1bae46ff34fc1d0a10a69c4db78127.tar.xz rsyslog-8c3ab2e26f1bae46ff34fc1d0a10a69c4db78127.zip |
bugfix: several smaller bugs resolved after flexelint review
Signed-off-by: Rainer Gerhards <rgerhards@adiscon.com>
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/conf.c | 8 | ||||
-rw-r--r-- | runtime/modules.c | 2 | ||||
-rw-r--r-- | runtime/vm.c | 3 |
3 files changed, 9 insertions, 4 deletions
diff --git a/runtime/conf.c b/runtime/conf.c index a1d74b93..34752726 100644 --- a/runtime/conf.c +++ b/runtime/conf.c @@ -500,7 +500,7 @@ finalize_it: rsRetVal cflineParseTemplateName(uchar** pp, omodStringRequest_t *pOMSR, int iEntry, int iTplOpts, uchar *dfltTplName) { uchar *p; - uchar *tplName; + uchar *tplName = NULL; cstr_t *pStrB; DEFiRet; @@ -537,10 +537,12 @@ rsRetVal cflineParseTemplateName(uchar** pp, omodStringRequest_t *pOMSR, int iEn CHKiRet(cstrConvSzStrAndDestruct(pStrB, &tplName, 0)); } - iRet = OMSRsetEntry(pOMSR, iEntry, tplName, iTplOpts); - if(iRet != RS_RET_OK) goto finalize_it; + CHKiRet(OMSRsetEntry(pOMSR, iEntry, tplName, iTplOpts)); finalize_it: + if(iRet != RS_RET_OK) + free(tplName); + *pp = p; RETiRet; diff --git a/runtime/modules.c b/runtime/modules.c index 32ae659f..90802c96 100644 --- a/runtime/modules.c +++ b/runtime/modules.c @@ -383,7 +383,7 @@ doModInit(rsRetVal (*modInit)(int, int*, rsRetVal(**)(), rsRetVal(*)(), modInfo_ * can never change in the lifetime of an module. -- rgerhards, 2007-12-14 */ CHKiRet((*pNew->modQueryEtryPt)((uchar*)"getType", &modGetType)); - CHKiRet((iRet = (*modGetType)(&pNew->eType)) != RS_RET_OK); + CHKiRet((*modGetType)(&pNew->eType)); dbgprintf("module of type %d being loaded.\n", pNew->eType); /* OK, we know we can successfully work with the module. So we now fill the diff --git a/runtime/vm.c b/runtime/vm.c index 8cbf9e12..da2f122b 100644 --- a/runtime/vm.c +++ b/runtime/vm.c @@ -87,6 +87,9 @@ rsfrAddFunction(uchar *szName, prsf_t rsf) funcRegRoot = pEntry; finalize_it: + if(iRet != RS_RET_OK && iRet != RS_RET_DUP_FUNC_NAME) + free(pEntry); + RETiRet; } |