提交 f84ae29a 编写于 作者: H Hewenliang 提交者: Arnaldo Carvalho de Melo

tools lib traceevent: Fix memory leakage in filter_event

It is necessary to call free_arg(arg) when add_filter_type() returns NULL
in filter_event().
Signed-off-by: NHewenliang <hewenliang4@huawei.com>
Reviewed-by: NSteven 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.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 9f0bff11
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册