projects
/
wrapfs-4.14.y.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
22946b8
)
tools lib traceevent: Fix memory leakage in filter_event
author
Hewenliang
<hewenliang4@huawei.com>
Mon, 9 Dec 2019 06:35:49 +0000
(
01:35
-0500)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Wed, 5 Feb 2020 21:22:43 +0000
(21:22 +0000)
[ 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@huawei.com>
Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Cc: Feilong Lin <linfeilong@huawei.com>
Cc: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Link:
http://lore.kernel.org/lkml/20191209063549.59941-1-hewenliang4@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/lib/traceevent/parse-filter.c
patch
|
blob
|
history
diff --git
a/tools/lib/traceevent/parse-filter.c
b/tools/lib/traceevent/parse-filter.c
index f3cbf86e51acf6e46ce70423e76b767798248754..20eed719542e5fcb9388d33cb93635db11c30f5e 100644
(file)
--- a/
tools/lib/traceevent/parse-filter.c
+++ b/
tools/lib/traceevent/parse-filter.c
@@
-1228,8
+1228,10
@@
filter_event(struct tep_event_filter *filter, struct tep_event *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);