diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-07-29 15:11:30 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-07-29 15:11:30 -0300 |
commit | 6e406257b3794009e3b7a6d48b54beb547719565 (patch) | |
tree | b2c79008271fd1741ac2b576379a3c29f4bc89e0 /tools/perf/util/symbol.c | |
parent | 39d17dacb3c25df878b56aa80a170d6088e041f9 (diff) | |
download | talos-op-linux-6e406257b3794009e3b7a6d48b54beb547719565.tar.gz talos-op-linux-6e406257b3794009e3b7a6d48b54beb547719565.zip |
perf symbols: Precisely specify if dso->{long,short}_name should be freed
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/symbol.c')
-rw-r--r-- | tools/perf/util/symbol.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index bc6e7e8c480d..242d2b216f46 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c @@ -224,7 +224,9 @@ void dso__delete(struct dso *self) int i; for (i = 0; i < MAP__NR_TYPES; ++i) symbols__delete(&self->symbols[i]); - if (self->long_name != self->name) + if (self->sname_alloc) + free((char *)self->short_name); + if (self->lname_alloc) free(self->long_name); free(self); } @@ -1530,6 +1532,7 @@ static int map_groups__set_modules_path_dir(struct map_groups *self, if (long_name == NULL) goto failure; dso__set_long_name(map->dso, long_name); + map->dso->lname_alloc = 1; dso__kernel_module_get_build_id(map->dso, ""); } } |