libtraceevent: Fix memory leakage in copy_filter_type
authorHewenliang <hewenliang4@huawei.com>
Tue, 19 Nov 2019 01:44:15 +0000 (20:44 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 31 Dec 2019 15:45:45 +0000 (16:45 +0100)
commitaa62f850b53d85da701d67ecc22e55d720b84042
treebaff300a88907fa20adc94ae401ee6457b6e9aa2
parentef88bd1fdb871b39d38f4d23accdf7a26b2acb21
libtraceevent: Fix memory leakage in copy_filter_type

[ Upstream commit 10992af6bf46a2048ad964985a5b77464e5563b1 ]

It is necessary to free the memory that we have allocated when error occurs.

Fixes: ef3072cd1d5c ("tools lib traceevent: Get rid of die in add_filter_type()")
Signed-off-by: Hewenliang <hewenliang4@huawei.com>
Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Cc: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Link: http://lore.kernel.org/lkml/20191119014415.57210-1-hewenliang4@huawei.com
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/lib/traceevent/parse-filter.c