]> git.baikalelectronics.ru Git - 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)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 26 Aug 2019 14:58:30 +0000 (11:58 -0300)
commit1d06af419e956a3fe9ef65d38600827606ec8ae7
tree22e536fc37323733041f88628eb878922098538c
parentaaf79b2006eb2076ba59c7f46b806f9daa54e7f4
perf script: Fix memory leaks in list_scripts()

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: 2a3fd92baf5f ("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>
tools/perf/ui/browsers/scripts.c