aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/symbol.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2010-07-29 14:11:30 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2010-07-29 14:11:30 -0400
commit6e406257b3794009e3b7a6d48b54beb547719565 (patch)
treeb2c79008271fd1741ac2b576379a3c29f4bc89e0 /tools/perf/util/symbol.c
parent39d17dacb3c25df878b56aa80a170d6088e041f9 (diff)
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.c5
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)
224 int i; 224 int i;
225 for (i = 0; i < MAP__NR_TYPES; ++i) 225 for (i = 0; i < MAP__NR_TYPES; ++i)
226 symbols__delete(&self->symbols[i]); 226 symbols__delete(&self->symbols[i]);
227 if (self->long_name != self->name) 227 if (self->sname_alloc)
228 free((char *)self->short_name);
229 if (self->lname_alloc)
228 free(self->long_name); 230 free(self->long_name);
229 free(self); 231 free(self);
230} 232}
@@ -1530,6 +1532,7 @@ static int map_groups__set_modules_path_dir(struct map_groups *self,
1530 if (long_name == NULL) 1532 if (long_name == NULL)
1531 goto failure; 1533 goto failure;
1532 dso__set_long_name(map->dso, long_name); 1534 dso__set_long_name(map->dso, long_name);
1535 map->dso->lname_alloc = 1;
1533 dso__kernel_module_get_build_id(map->dso, ""); 1536 dso__kernel_module_get_build_id(map->dso, "");
1534 } 1537 }
1535 } 1538 }