diff options
| author | Adrian Hunter <[email protected]> | 2022-06-20 10:39:04 +0000 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <[email protected]> | 2022-06-26 15:32:15 +0000 |
| commit | 342cb0d80613719c5e5ac30619e54b9a3fd83625 (patch) | |
| tree | 126e4e77ce14b5abfd116ce7af13c25f25e79919 /tools/perf/builtin-inject.c | |
| parent | Merge tag 'char-misc-5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/g... (diff) | |
| download | kernel-342cb0d80613719c5e5ac30619e54b9a3fd83625.tar.gz kernel-342cb0d80613719c5e5ac30619e54b9a3fd83625.zip | |
perf inject: Fix missing free in copy_kcore_dir()
Free string allocated by asprintf().
Fixes: d8fc08550929bb84 ("perf inject: Keep a copy of kcore_dir")
Signed-off-by: Adrian Hunter <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: Jiri Olsa <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/builtin-inject.c')
| -rw-r--r-- | tools/perf/builtin-inject.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c index a75bf11585b5..063f74f5b8db 100644 --- a/tools/perf/builtin-inject.c +++ b/tools/perf/builtin-inject.c @@ -891,7 +891,9 @@ static int copy_kcore_dir(struct perf_inject *inject) if (ret < 0) return ret; pr_debug("%s\n", cmd); - return system(cmd); + ret = system(cmd); + free(cmd); + return ret; } static int output_fd(struct perf_inject *inject) |
