lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <157713691499.30329.2623110005422397887.tip-bot2@tip-bot2>
Date:   Mon, 23 Dec 2019 21:35:14 -0000
From:   "tip-bot2 for Hewenliang" <tip-bot2@...utronix.de>
To:     linux-tip-commits@...r.kernel.org
Cc:     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>,
        x86 <x86@...nel.org>, LKML <linux-kernel@...r.kernel.org>
Subject: [tip: perf/urgent] tools lib traceevent: Fix memory leakage in filter_event

The following commit has been merged into the perf/urgent branch of tip:

Commit-ID:     f84ae29a6169318f9c929720c49d96323d2bbab9
Gitweb:        https://git.kernel.org/tip/f84ae29a6169318f9c929720c49d96323d2bbab9
Author:        Hewenliang <hewenliang4@...wei.com>
AuthorDate:    Mon, 09 Dec 2019 01:35:49 -05:00
Committer:     Arnaldo Carvalho de Melo <acme@...hat.com>
CommitterDate: Fri, 20 Dec 2019 18:47:50 -03:00

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: 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>
---
 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 f3cbf86..20eed71 100644
--- 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);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ