diff options
| author | Riccardo Mancini <[email protected]> | 2021-07-15 16:07:14 +0000 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <[email protected]> | 2021-07-15 20:27:52 +0000 |
| commit | a37338aad8c4d8676173ead14e881d2ec308155c (patch) | |
| tree | 0702b3d65f0d7c4d9914c268ca087ae21aa50b49 /tools/perf/builtin-inject.c | |
| parent | perf env: Fix memory leak of cpu_pmu_caps (diff) | |
| download | kernel-a37338aad8c4d8676173ead14e881d2ec308155c.tar.gz kernel-a37338aad8c4d8676173ead14e881d2ec308155c.zip | |
perf report: Free generated help strings for sort option
ASan reports the memory leak of the strings allocated by sort_help() when
running perf report.
This patch changes the returned pointer to char* (instead of const
char*), saves it in a temporary variable, and finally deallocates it at
function exit.
Signed-off-by: Riccardo Mancini <[email protected]>
Fixes: 702fb9b415e7c99b ("perf report: Show all sort keys in help output")
Cc: Andi Kleen <[email protected]>
Cc: Ian Rogers <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Link: http://lore.kernel.org/lkml/a38b13f02812a8a6759200b9063c6191337f44d4.1626343282.git.rickyman7@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/builtin-inject.c')
0 files changed, 0 insertions, 0 deletions
