]> git.baikalelectronics.ru Git - kernel.git/commit
perf test: Add free() calls for scandir() returned dirent entries
authorRiccardo Mancini <rickyman7@gmail.com>
Fri, 9 Jul 2021 16:34:53 +0000 (18:34 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 9 Jul 2021 18:34:41 +0000 (15:34 -0300)
commit39499bd8f701fc92847544d65a4b3c0cee78013f
tree56ed8a1c6a99b26d271acfacc38ff40eb9060994
parentf5749823a680e65444c805f6f5782b05d59e0b52
perf test: Add free() calls for scandir() returned dirent entries

ASan reported a memory leak for items of the entlist returned from scandir().

In fact, scandir() returns a malloc'd array of malloc'd dirents.

This patch adds the missing (z)frees.

Fixes: a181d67f4ae73b1d ("perf test: Iterate over shell tests in alphabetical order")
Signed-off-by: Riccardo Mancini <rickyman7@gmail.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Fabian Hemmer <copy@copy.sh>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Remi Bernon <rbernon@codeweavers.com>
Link: http://lore.kernel.org/lkml/20210709163454.672082-1-rickyman7@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/tests/builtin-test.c