summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2010-02-04 16:43:21 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2010-02-04 16:43:21 +0100
commitef193bf0ae75d206e4b50022f8c07e3b908c8491 (patch)
tree2ea9d48da9884b532e02a129565b68f648105280
parent66d129c9ca24f6f3001fad9cc854c54a360df49e (diff)
parent8c3ab2e26f1bae46ff34fc1d0a10a69c4db78127 (diff)
downloadrsyslog-ef193bf0ae75d206e4b50022f8c07e3b908c8491.tar.gz
rsyslog-ef193bf0ae75d206e4b50022f8c07e3b908c8491.tar.xz
rsyslog-ef193bf0ae75d206e4b50022f8c07e3b908c8491.zip
Merge branch 'v4-stable' into v4-beta
-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 b8277234..37b70c8f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -191,6 +191,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 7b5a46e1..d9f80c14 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 b92664a1..ef795237 100644
--- a/runtime/conf.c
+++ b/runtime/conf.c
@@ -513,7 +513,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;
@@ -550,10 +550,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 d7cd52d5..aaf3c879 100644
--- a/runtime/vm.c
+++ b/runtime/vm.c
@@ -88,6 +88,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 0116e782..8c13573b 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 02f19eac..a6d83eb9 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;
}