]> git.baikalelectronics.ru Git - kernel.git/commit
perf stat: Fix memory leak on error path
authorIan Rogers <irogers@google.com>
Sun, 7 Nov 2021 08:54:44 +0000 (01:54 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Sun, 7 Nov 2021 15:44:53 +0000 (12:44 -0300)
commit3502f0a219f11ff92f4189896166ccb6df0efdd5
treebc776ad604f8cd3c5cf14cec89425d0429c5fb26
parent0629764c7c21d2f0c525b4f36c9c681098605b33
perf stat: Fix memory leak on error path

strdup() is used to deduplicate, ensure it isn't leaking an already
created string by freeing first.

Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: John Garry <john.garry@huawei.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lore.kernel.org/lkml/20211107085444.3781604-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/stat-shadow.c