mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
tools lib traceevent: Fix memory leakage in filter_event
[ Upstream commit f84ae29a6169318f9c929720c49d96323d2bbab9 ] It is necessary to call free_arg(arg) when add_filter_type() returns NULL in filter_event(). Signed-off-by: Hewenliang <[email protected]> Reviewed-by: Steven Rostedt (VMware) <[email protected]> Cc: Feilong Lin <[email protected]> Cc: Tzvetomir Stoyanov <[email protected]> Link: http://lore.kernel.org/lkml/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
parent
22946b8397
commit
91f91139d3
1 changed files with 3 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue