File 0007-bugfix-small-memory-leak-in-omfile-s-outchannel-code.patch of Package rsyslog.6132

From 5e3d81f71bd8bc142a006b450299a74caa1888ff Mon Sep 17 00:00:00 2001
From: Rainer Gerhards <rgerhards@adiscon.com>
Date: Thu, 8 Jan 2015 16:57:18 +0100
Subject: [PATCH] bugfix: (small) memory leak in omfile's outchannel code

Thanks to Koral Ilgun for reporting this issue.
---
 ChangeLog        | 2 ++
 runtime/stream.c | 2 ++
 2 files changed, 4 insertions(+)

#diff --git a/ChangeLog b/ChangeLog
#index d49d9c3..6738018 100644
#--- a/ChangeLog
#+++ b/ChangeLog
#@@ -16,6 +16,8 @@ Version 8.7.0 [v8-stable] 2015-01-13
# - bugfix: emit correct error message on config-file-not-found
#   closes https://github.com/rsyslog/rsyslog/issues/173
# - bugfix: impstats emitted invalid JSON format (if JSON was selected)
#+- bugfix: (small) memory leak in omfile's outchannel code
#+  Thanks to Koral Ilgun for reporting this issue.
# ------------------------------------------------------------------------------
 Version 8.6.0 [v8-stable] 2014-12-02
 NOTE: This version also incorporates all changes and enhancements made for
diff --git a/runtime/stream.c b/runtime/stream.c
index d81e570..fe7a9d7 100644
--- a/runtime/stream.c
+++ b/runtime/stream.c
@@ -810,6 +810,7 @@ BEGINobjConstruct(strm) /* be sure to specify the object type also in END macro!
 	pThis->sType = STREAMTYPE_FILE_SINGLE;
 	pThis->sIOBufSize = glblGetIOBufSize();
 	pThis->tOpenMode = 0600;
+	pThis->pszSizeLimitCmd = NULL;
 	pThis->prevLineSegment = NULL;
 ENDobjConstruct(strm)
 
@@ -941,6 +942,7 @@ CODESTARTobjDestruct(strm)
 	free(pThis->pZipBuf);
 	free(pThis->pszCurrFName);
 	free(pThis->pszFName);
+	free(pThis->pszSizeLimitCmd);
 	pThis->bStopWriter = 2; /* RG: use as flag for destruction */
 ENDobjDestruct(strm)
 
-- 
2.6.6

openSUSE Build Service is sponsored by