From: Jonathan Rajotte Date: Tue, 1 Mar 2022 15:27:37 +0000 (-0500) Subject: Fix: common: local_attr might leak X-Git-Tag: v2.12.9~22 X-Git-Url: http://git.liburcu.org/?a=commitdiff_plain;h=d133f6d7bba25fb5662108987a929abbfcaabc7f;p=lttng-tools.git Fix: common: local_attr might leak 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 --- diff --git a/src/common/event.c b/src/common/event.c index af4a4b1a3..850b97f14 100644 --- a/src/common/event.c +++ b/src/common/event.c @@ -194,6 +194,7 @@ static ssize_t lttng_event_probe_attr_create_from_buffer( local_attr = NULL; ret = offset; end: + free(local_attr); return ret; } @@ -252,6 +253,7 @@ static ssize_t lttng_event_function_attr_create_from_buffer( local_attr = NULL; ret = offset; end: + free(local_attr); return ret; }