提交 68c465ad 编写于 作者: T Thomas Jarosch 提交者: Arnaldo Carvalho de Melo

perf tools: Fix possible double free on error

Can only be triggered via CROSS_COMPILE env var.

Detected by cppcheck.
Signed-off-by: NThomas Jarosch <thomas.jarosch@intra2net.com>
Link: http://lkml.kernel.org/r/36736865.AIlztKhDqN@stormSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 e3541ec7
...@@ -155,6 +155,7 @@ static int perf_session_env__lookup_binutils_path(struct perf_session_env *env, ...@@ -155,6 +155,7 @@ static int perf_session_env__lookup_binutils_path(struct perf_session_env *env,
if (lookup_path(buf)) if (lookup_path(buf))
goto out; goto out;
free(buf); free(buf);
buf = NULL;
} }
if (!strcmp(arch, "arm")) if (!strcmp(arch, "arm"))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册