lkml.org 
[lkml]   [2022]   [Jun]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] perf inject: Fix missing free in copy_kcore_dir()
Em Mon, Jun 20, 2022 at 01:39:04PM +0300, Adrian Hunter escreveu:
> Free string allocated by asprintf().
>
> Fixes: d8fc08550929bb ("perf inject: Keep a copy of kcore_dir")
> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>

Thanks, applied.

- Arnaldo

> ---
> tools/perf/builtin-inject.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c
> index 42e2918fd1cc..fee9da14afc6 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)
> --
> 2.25.1

--

- Arnaldo

\
 
 \ /
  Last update: 2022-06-20 23:00    [W:0.056 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site