summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-07-13 15:55:46 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-07-13 15:55:46 +0200
commitfec2041e037426ac227ee619b59629e059099d05 (patch)
treeaf59860c7b037b2ca0d7ce85a2384ab1b5ca3e04 /tools
parent6511278082a7e1e9602385cd24cdb5e363cb702f (diff)
parentef9722ec87c8a7ddb2d499c1e7863475d8790a94 (diff)
downloadrsyslog-fec2041e037426ac227ee619b59629e059099d05.tar.gz
rsyslog-fec2041e037426ac227ee619b59629e059099d05.tar.xz
rsyslog-fec2041e037426ac227ee619b59629e059099d05.zip
Merge branch 'v3-stable' into v4-stable
Conflicts: ChangeLog configure.ac doc/manual.html
Diffstat (limited to 'tools')
-rw-r--r--tools/omfwd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/omfwd.c b/tools/omfwd.c
index 88a382e0..e91387c8 100644
--- a/tools/omfwd.c
+++ b/tools/omfwd.c
@@ -411,11 +411,11 @@ CODESTARTdoAction
*/
if(pData->compressionLevel && (l > MIN_SIZE_FOR_COMPRESS)) {
Bytef *out;
- uLongf destLen = sizeof(out) / sizeof(Bytef);
+ uLongf destLen = iMaxLine + iMaxLine/100 +12; /* recommended value from zlib doc */
uLong srcLen = l;
int ret;
/* TODO: optimize malloc sequence? -- rgerhards, 2008-09-02 */
- CHKmalloc(out = (Bytef*) malloc(iMaxLine + iMaxLine/100 + 12));
+ CHKmalloc(out = (Bytef*) malloc(destLen));
out[0] = 'z';
out[1] = '\0';
ret = compress2((Bytef*) out+1, &destLen, (Bytef*) psz,