perf sched: Make sure it frees the usage string
authorNamhyung Kim <namhyung@kernel.org>
Thu, 3 Jul 2025 01:49:35 +0000 (18:49 -0700)
committerNamhyung Kim <namhyung@kernel.org>
Thu, 3 Jul 2025 18:27:58 +0000 (11:27 -0700)
commit10d9b89203765fb776512742c13af8dd92821842
treebe1babe0555bffb78f10a6cfe8cf9c3dcd8e2f1b
parent8081ca8d6be8c4b08b5d2fa06b2129f00aa95451
perf sched: Make sure it frees the usage string

The parse_options_subcommand() allocates the usage string based on the
given subcommands.  So it should reach the end of the function to free
the string to prevent memory leaks.

Fixes: 1a5efc9e13f357ab ("libsubcmd: Don't free the usage string")
Reviewed-by: Ian Rogers <irogers@google.com>
Tested-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20250703014942.1369397-2-namhyung@kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/builtin-sched.c