Skip to content

Commit 342cb0d

Browse files
ahunter6acmel
authored andcommitted
perf inject: Fix missing free in copy_kcore_dir()
Free string allocated by asprintf(). Fixes: d8fc085 ("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]>
1 parent 0840a79 commit 342cb0d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tools/perf/builtin-inject.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,9 @@ static int copy_kcore_dir(struct perf_inject *inject)
891891
if (ret < 0)
892892
return ret;
893893
pr_debug("%s\n", cmd);
894-
return system(cmd);
894+
ret = system(cmd);
895+
free(cmd);
896+
return ret;
895897
}
896898

897899
static int output_fd(struct perf_inject *inject)

0 commit comments

Comments
 (0)