From 9eb895d71ff4061966b9ef4677fbe14a2ddded12 Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Tue, 1 Mar 2022 10:27:37 -0500 Subject: [PATCH] Fix: common: local_attr might leak MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reported by Coverity: CID 1475808: Resource leak (RESOURCE_LEAK) Variable local_attr going out of scope leaks the storage it points to. CID 1475810: Resource leak (RESOURCE_LEAK) Variable local_attr going out of scope leaks the storage it points to. Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau Change-Id: Ibe2ee6516618827b6f52676d9a9f7d510cadf1bc --- src/common/event.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/common/event.cpp b/src/common/event.cpp index 6d82504e2..9525d7132 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -200,6 +200,7 @@ static ssize_t lttng_event_probe_attr_create_from_payload( local_attr = NULL; ret = offset; end: + free(local_attr); return ret; } @@ -261,6 +262,7 @@ static ssize_t lttng_event_function_attr_create_from_payload( local_attr = NULL; ret = offset; end: + free(local_attr); return ret; } -- 2.34.1