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/vm.c3
-rw-r--r--template.c5
-rw-r--r--tools/omfwd.c3
6 files changed, 23 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 496aa8a3..00af71d9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -512,6 +512,8 @@ Version 4.5.0 [DEVEL] (rgerhards), 2009-07-02
an abort
---------------------------------------------------------------------------
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 49d3f07e..08aaad80 100644
--- a/plugins/omgssapi/omgssapi.c
+++ b/plugins/omgssapi/omgssapi.c
@@ -431,11 +431,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;
}
@@ -450,6 +453,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 e7c1576f..96d9dcab 100644
--- a/runtime/conf.c
+++ b/runtime/conf.c
@@ -512,7 +512,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;
@@ -549,10 +549,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/vm.c b/runtime/vm.c
index a1d992c3..0ed174d1 100644
--- a/runtime/vm.c
+++ b/runtime/vm.c
@@ -91,6 +91,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 06cad211..23d4b62e 100644
--- a/template.c
+++ b/template.c
@@ -427,10 +427,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 0fac251b..1e9e6c27 100644
--- a/tools/omfwd.c
+++ b/tools/omfwd.c
@@ -458,11 +458,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;
}