perf tools: Use zfree() to avoid keeping dangling pointers
authorTaeung Song <treeze.taeung@gmail.com>
Wed, 1 Feb 2017 12:34:07 +0000 (21:34 +0900)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 8 Feb 2017 12:41:12 +0000 (09:41 -0300)
commit360e071b1822d40357e371357f24f6ec43f0a080
tree0e02ef69ade6c9e2ebe082ef05afdf25ea6b5736
parent506fde11a35f39e1b44478339c41e94dfd278aa2
perf tools: Use zfree() to avoid keeping dangling pointers

The cases changed in this patch are for when we free but keep the
pointer to the freed area, which is not always a good idea.

Be more defensive and zero the pointer to avoid possible use after
free bugs to take more time to be detected.

Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1485952447-7013-5-git-send-email-treeze.taeung@gmail.com
[ rewrote commit log ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/parse-events.c