From 0cd15588f76d86377a5f1e5656cbef5d217bde97 Mon Sep 17 00:00:00 2001 From: Tim Klemm Date: Thu, 16 Jan 2025 07:18:55 -0500 Subject: [PATCH] HPCC-33259: Fix CModularTracer memory leak Own the default sink before insertion into the sink map. THe owned reference will be released, leaving only the map's reference. Signed-off-by: Tim Klemm --- system/masking/include/tracer.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system/masking/include/tracer.hpp b/system/masking/include/tracer.hpp index 70cc9534c4a..3aef92ce189 100644 --- a/system/masking/include/tracer.hpp +++ b/system/masking/include/tracer.hpp @@ -135,7 +135,8 @@ class CModularTracer : public CBaseTracer public: CModularTracer() { - setSink(DefaultHelperName, new CStandardTraceMsgSink()); + Owned sink(new CStandardTraceMsgSink()); + setSink(DefaultHelperName, sink); } inline bool setSink(IModularTraceMsgSink* sink) {