diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2022-06-20 13:39:04 +0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2022-06-26 12:32:15 -0300 |
commit | 342cb0d80613719c5e5ac30619e54b9a3fd83625 (patch) | |
tree | 126e4e77ce14b5abfd116ce7af13c25f25e79919 /tools/perf | |
parent | 0840a7914caa14315a3191178a9f72c742477860 (diff) |
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 <adrian.hunter@intel.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/r/20220620103904.7960-1-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-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) |