Commit-ID:  d4f74eb89199dc7bde5579783e9188841e1271e3
Gitweb:     http://git.kernel.org/tip/d4f74eb89199dc7bde5579783e9188841e1271e3
Author:     Chenggang Qin <chenggang....@taobao.com>
AuthorDate: Fri, 11 Oct 2013 08:27:59 +0800
Committer:  Arnaldo Carvalho de Melo <a...@redhat.com>
CommitDate: Mon, 14 Oct 2013 12:21:20 -0300

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....@taobao.com>
Acked-by: Namhyung Kim <namhy...@kernel.org>
Cc: Andrew Morton <a...@linux-foundation.org>
Cc: Arjan van de Ven <ar...@linux.intel.com>
Cc: David Ahern <dsah...@gmail.com>
Cc: Ingo Molnar <mi...@redhat.com>
Cc: Mike Galbraith <efa...@gmx.de>
Cc: Namhyung Kim <namhy...@gmail.com>
Cc: Paul Mackerras <pau...@samba.org>
Cc: Peter Zijlstra <a.p.zijls...@chello.nl>
Cc: Wu Fengguang <fengguang...@intel.com>
Cc: Yanmin Zhang <yanmin.zh...@intel.com>
Link: 
http://lkml.kernel.org/r/1381451279-4109-3-git-send-email-chenggang....@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <a...@redhat.com>
---
 tools/perf/util/symbol.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index b66c1ee..c0c3696 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -160,10 +160,12 @@ again:
 
                if (choose_best_symbol(curr, next) == SYMBOL_A) {
                        rb_erase(&next->rb_node, symbols);
+                       symbol__delete(next);
                        goto again;
                } else {
                        nd = rb_next(&curr->rb_node);
                        rb_erase(&curr->rb_node, symbols);
+                       symbol__delete(curr);
                }
        }
 }
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to