[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200203161916.756297458@linuxfoundation.org>
Date: Mon, 3 Feb 2020 16:19:41 +0000
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Hewenliang <hewenliang4@...wei.com>,
"Steven Rostedt (VMware)" <rostedt@...dmis.org>,
Feilong Lin <linfeilong@...wei.com>,
Tzvetomir Stoyanov <tstoyanov@...are.com>,
Arnaldo Carvalho de Melo <acme@...hat.com>,
Sasha Levin <sashal@...nel.org>
Subject: [PATCH 4.19 29/70] tools lib traceevent: Fix memory leakage in filter_event
From: Hewenliang <hewenliang4@...wei.com>
[ Upstream commit f84ae29a6169318f9c929720c49d96323d2bbab9 ]
It is necessary to call free_arg(arg) when add_filter_type() returns NULL
in filter_event().
Signed-off-by: Hewenliang <hewenliang4@...wei.com>
Reviewed-by: Steven Rostedt (VMware) <rostedt@...dmis.org>
Cc: Feilong Lin <linfeilong@...wei.com>
Cc: Tzvetomir Stoyanov <tstoyanov@...are.com>
Link: http://lore.kernel.org/lkml/20191209063549.59941-1-hewenliang4@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
tools/lib/traceevent/parse-filter.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/lib/traceevent/parse-filter.c b/tools/lib/traceevent/parse-filter.c
index 2700f1f17876e..27248a0aad84a 100644
--- a/tools/lib/traceevent/parse-filter.c
+++ b/tools/lib/traceevent/parse-filter.c
@@ -1227,8 +1227,10 @@ filter_event(struct event_filter *filter, struct event_format *event,
}
filter_type = add_filter_type(filter, event->id);
- if (filter_type == NULL)
+ if (filter_type == NULL) {
+ free_arg(arg);
return TEP_ERRNO__MEM_ALLOC_FAILED;
+ }
if (filter_type->filter)
free_arg(filter_type->filter);
--
2.20.1
Powered by blists - more mailing lists