summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-07-13 15:52:45 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-07-13 15:52:45 +0200
commit47ca77faca5442014309e6d2ffa3c0484d160da4 (patch)
tree6ed6d602f8a0a282a632574f565bd3104e045f9d /tools
parent6fff4ae3329e852586f3a14ac8b8369bc6d61148 (diff)
parentef9722ec87c8a7ddb2d499c1e7863475d8790a94 (diff)
downloadrsyslog-47ca77faca5442014309e6d2ffa3c0484d160da4.tar.gz
rsyslog-47ca77faca5442014309e6d2ffa3c0484d160da4.tar.xz
rsyslog-47ca77faca5442014309e6d2ffa3c0484d160da4.zip
Merge branch 'v3-stable' into v4-beta
Conflicts: ChangeLog
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 e41e5b66..d207cce5 100644
--- a/tools/omfwd.c
+++ b/tools/omfwd.c
@@ -436,11 +436,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,