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)
commiteb7261f14e1a86f0fd299a2ec408990d349ce3d1
tree56ed8a1c6a99b26d271acfacc38ff40eb9060994
parentafd4ad01ff0441fdb3f2907f9f8c6e019e62270f
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: da963834fe6975a1 ("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