diff options
| author | Ian Rogers <irogers@google.com> | 2026-08-09 00:14:45 -0700 |
|---|---|---|
| committer | Namhyung Kim <namhyung@kernel.org> | 2026-08-09 21:58:11 -0700 |
| commit | 44e82c4d2ff37f073946b594840fd549ab6b9fb8 (patch) | |
| tree | 2a271419dadc2517caf70cb6864d36a4ed01064c /tools | |
| parent | 54ba44db4dddc4ca06b49bae0f9d6c5861430b18 (diff) | |
perf test: Fix skiplist leak in cmd_test
Fix a memory leak in cmd_test() where skiplist was not freed on
exit paths.
Assisted-by: Antigravity:gemini-3.1-pro
Fixes: 2ae828786c65 ("perf test: Allow skipping tests")
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/perf/tests/builtin-test.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c index 41dcfbf874f0..4d0784b16723 100644 --- a/tools/perf/tests/builtin-test.c +++ b/tools/perf/tests/builtin-test.c @@ -1802,9 +1802,14 @@ int cmd_test(int argc, const char **argv) rlimit__bump_memlock(); suites = build_suites(); - if (!suites) - return errno ? -errno : -ENOMEM; + if (!suites) { + int err = errno; + + intlist__delete(skiplist); + return err ? -err : -ENOMEM; + } ret = __cmd_test(suites, argc, argv, skiplist); free(suites); + intlist__delete(skiplist); return ret; } |
