rsyslog/backport-Deallocate-outchannel-resources-in-rsconf-destructor.patch

40 lines
1.2 KiB
Diff
Raw Normal View History

2022-12-30 16:53:23 +08:00
From 4fc5ed645a125661ce773ecf5376df5062305976 Mon Sep 17 00:00:00 2001
From: alakatos <alakatos@redhat.com>
Date: Tue, 30 Nov 2021 18:13:23 +0100
Subject: [PATCH] Deallocate outchannel resources in rsconf destructor
Conflict:NA
Reference:https://github.com/rsyslog/rsyslog/commit/4fc5ed645a125661ce773ecf5376df5062305976
---
outchannel.c | 4 ++++
runtime/rsconf.c | 1 +
2 files changed, 5 insertions(+)
diff --git a/outchannel.c b/outchannel.c
index db78d93763..ba5809f4af 100644
--- a/outchannel.c
+++ b/outchannel.c
@@ -272,6 +272,10 @@ void ochDeleteAll(void)
pOch = pOch->pNext;
if(pOchDel->pszName != NULL)
free(pOchDel->pszName);
+ if(pOchDel->pszFileTemplate != NULL)
+ free(pOchDel->pszFileTemplate);
+ if(pOchDel->cmdOnSizeLimit != NULL)
+ free(pOchDel->cmdOnSizeLimit);
free(pOchDel);
}
}
diff --git a/runtime/rsconf.c b/runtime/rsconf.c
index 3042a16849..6eb7042526 100644
--- a/runtime/rsconf.c
+++ b/runtime/rsconf.c
@@ -240,6 +240,7 @@ CODESTARTobjDestruct(rsconf)
tplDeleteAll(pThis);
dynstats_destroyAllBuckets();
perctileBucketsDestruct();
+ ochDeleteAll();
free(pThis->globals.mainQ.pszMainMsgQFName);
free(pThis->globals.pszConfDAGFile);
lookupDestroyCnf();