diff options
author | Chenggang Qin <chenggang.qcg@taobao.com> | 2013-10-10 20:27:59 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-10-14 11:21:20 -0400 |
commit | d4f74eb89199dc7bde5579783e9188841e1271e3 (patch) | |
tree | 1c0aa173b26be095f882cc9467cb4ac9e64a3508 /tools/perf/util | |
parent | 1d5077bdd9a10c4297cded139989bb9ee2998a6c (diff) |
perf symbols: Fix a memory leak due to symbol__delete not being used
In function symbols__fixup_duplicate(), while duplicated symbols are
found, only the rb_node is removed from the tree. The symbol structures
themself are ignored. Then, these memory areas are lost.
Signed-off-by: Chenggang Qin <chenggang.qcg@taobao.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Wu Fengguang <fengguang.wu@intel.com>
Cc: Yanmin Zhang <yanmin.zhang@intel.com>
Link: http://lkml.kernel.org/r/1381451279-4109-3-git-send-email-chenggang.qin@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util')
-rw-r--r-- | tools/perf/util/symbol.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index b66c1eefc313..c0c36965fff0 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c | |||
@@ -160,10 +160,12 @@ again: | |||
160 | 160 | ||
161 | if (choose_best_symbol(curr, next) == SYMBOL_A) { | 161 | if (choose_best_symbol(curr, next) == SYMBOL_A) { |
162 | rb_erase(&next->rb_node, symbols); | 162 | rb_erase(&next->rb_node, symbols); |
163 | symbol__delete(next); | ||
163 | goto again; | 164 | goto again; |
164 | } else { | 165 | } else { |
165 | nd = rb_next(&curr->rb_node); | 166 | nd = rb_next(&curr->rb_node); |
166 | rb_erase(&curr->rb_node, symbols); | 167 | rb_erase(&curr->rb_node, symbols); |
168 | symbol__delete(curr); | ||
167 | } | 169 | } |
168 | } | 170 | } |
169 | } | 171 | } |