summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--plugins/omgssapi/omgssapi.c9
-rw-r--r--runtime/conf.c8
-rw-r--r--runtime/modules.c2
-rw-r--r--runtime/vm.c3
-rw-r--r--template.c5
-rw-r--r--tools/omfwd.c3
7 files changed, 24 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 33ae5ad6..2eb63c78 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
---------------------------------------------------------------------------
Version 4.4.3 [v4-stable] (rgerhards), 2009-10-??
+- bugfix: several smaller bugs resolved after flexelint review
+ Thanks to varmojfekoj for the patch.
- bugfix: $ActionExecOnlyOnceEveryInterval did not work.
This was a regression from the time() optimizations done in v4.
Bug tracker: http://bugzilla.adiscon.com/show_bug.cgi?id=143
diff --git a/plugins/omgssapi/omgssapi.c b/plugins/omgssapi/omgssapi.c
index 361f657f..c2c08369 100644
--- a/plugins/omgssapi/omgssapi.c
+++ b/plugins/omgssapi/omgssapi.c
@@ -430,11 +430,14 @@ CODESTARTdoAction
* rgerhards, 2006-11-30
*/
dbgprintf("Compression failed, sending uncompressed message\n");
+ free(out);
} else if(destLen+1 < l) {
/* only use compression if there is a gain in using it! */
dbgprintf("there is gain in compression, so we do it\n");
psz = (char*) out;
l = destLen + 1; /* take care for the "z" at message start! */
+ } else {
+ free(out);
}
++destLen;
}
@@ -449,6 +452,12 @@ CODESTARTdoAction
break;
}
finalize_it:
+# ifdef USE_NETZIP
+ if(psz != (char*) ppString[0]) {
+ /* we need to free temporary buffer, alloced above - Naoya Nakazawa, 2010-01-11 */
+ free(psz);
+ }
+# endif
ENDdoAction
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;
}
diff --git a/template.c b/template.c
index 6e34bcd8..f8615fee 100644
--- a/template.c
+++ b/template.c
@@ -431,10 +431,7 @@ static int do_Constant(unsigned char **pp, struct template *pTpl)
}
if((pTpe = tpeConstruct(pTpl)) == NULL) {
- /* OK, we are out of luck. Let's invalidate the
- * entry and that's it.
- */
- pTpe->eEntryType = UNDEFINED;
+ rsCStrDestruct(&pStrB);
return 1;
}
pTpe->eEntryType = CONSTANT;
diff --git a/tools/omfwd.c b/tools/omfwd.c
index 97703c79..60c7055a 100644
--- a/tools/omfwd.c
+++ b/tools/omfwd.c
@@ -455,11 +455,14 @@ CODESTARTdoAction
* rgerhards, 2006-11-30
*/
dbgprintf("Compression failed, sending uncompressed message\n");
+ free(out);
} else if(destLen+1 < l) {
/* only use compression if there is a gain in using it! */
dbgprintf("there is gain in compression, so we do it\n");
psz = (char*) out;
l = destLen + 1; /* take care for the "z" at message start! */
+ } else {
+ free(out);
}
++destLen;
}