commit | 046625231a0397f1776eb353a4ec9ff142cd2f6b | [log] [tgz] |
---|---|---|
author | Arnaldo Carvalho de Melo <[email protected]> | Thu Dec 26 17:41:15 2013 -0300 |
committer | Arnaldo Carvalho de Melo <[email protected]> | Fri Dec 27 15:17:00 2013 -0300 |
tree | 6ce7ab043539d2432b135bc61f39febb3a032039 | |
parent | f5385650c02cd4373c4124c8a8fac3b5f9851e7f [diff] [blame] |
perf tools: Introduce zfree For the frequent idiom of: free(ptr); ptr = NULL; Make it expect a pointer to the pointer being freed, so that it becomes clear at first sight that the variable being freed is being modified. Cc: Adrian Hunter <[email protected]> Cc: David Ahern <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Stephane Eranian <[email protected]> Link: http://lkml.kernel.org/n/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index 4136f99..ab65057 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c
@@ -180,8 +180,7 @@ * symbol, free he->ms.sym->src to signal we already * processed this symbol. */ - free(notes->src); - notes->src = NULL; + zfree(¬es->src); } } }