Browse Source

perf tools: Fix possible double free on error

Can only be triggered via CROSS_COMPILE env var.

Detected by cppcheck.

Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
Link: http://lkml.kernel.org/r/36736865.AIlztKhDqN@storm
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Thomas Jarosch 12 years ago
parent
commit
68c465ada5
1 changed files with 1 additions and 0 deletions
  1. 1 0
      tools/perf/arch/common.c

+ 1 - 0
tools/perf/arch/common.c

@@ -155,6 +155,7 @@ static int perf_session_env__lookup_binutils_path(struct perf_session_env *env,
 		if (lookup_path(buf))
 			goto out;
 		free(buf);
+		buf = NULL;
 	}
 
 	if (!strcmp(arch, "arm"))