]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
perf script: Fix memory leaks in list_scripts()
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Mon, 8 Apr 2019 16:27:48 +0000 (11:27 -0500)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 18 Oct 2019 08:25:56 +0000 (04:25 -0400)
commita53fe973cab89353611a91af43b2d349e4d3d7b9
tree66e8a95e8e2e84f441a76c4c951d64e7b3e04916
parent2c1e200102cc83c537cf8201ad641a4a7f6d0ab0
perf script: Fix memory leaks in list_scripts()

BugLink: https://bugs.launchpad.net/bugs/1848046
[ Upstream commit 3b4acbb92dbda4829e021e5c6d5410658849fa1c ]

In case memory resources for *buf* and *paths* were allocated, jump to
*out* and release them before return.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Gustavo A. R. Silva <gustavo@embeddedor.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Addresses-Coverity-ID: 1444328 ("Resource leak")
Fixes: 6f3da20e151f ("perf report: Support builtin perf script in scripts menu")
Link: http://lkml.kernel.org/r/20190408162748.GA21008@embeddedor
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
tools/perf/ui/browsers/scripts.c