From 1e62f6a644e79e27edf1215ae893d08560258d66 Mon Sep 17 00:00:00 2001 From: David Ahern Date: Sat, 8 Sep 2012 09:06:50 -0600 Subject: [PATCH] --- yaml --- r: 323793 b: refs/heads/master c: bfd14b9a7231e7cf77520bca1848c40c6b6360ae h: refs/heads/master i: 323791: df73df1128e1f6366cfb080df8e4551d37fd951f v: v3 --- [refs] | 2 +- trunk/tools/perf/util/annotate.c | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index a5083cbc5253..344daf45b66b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 12ceaded6b276c13d905cf09f0c1a1322022ea58 +refs/heads/master: bfd14b9a7231e7cf77520bca1848c40c6b6360ae diff --git a/trunk/tools/perf/util/annotate.c b/trunk/tools/perf/util/annotate.c index 51ef69c9841d..04eafd3939df 100644 --- a/trunk/tools/perf/util/annotate.c +++ b/trunk/tools/perf/util/annotate.c @@ -984,7 +984,8 @@ int symbol__annotate_printf(struct symbol *sym, struct map *map, int evidx, int context) { struct dso *dso = map->dso; - const char *filename = dso->long_name, *d_filename; + char *filename; + const char *d_filename; struct annotation *notes = symbol__annotation(sym); struct disasm_line *pos, *queue = NULL; u64 start = map__rip_2objdump(map, sym->start); @@ -992,6 +993,10 @@ int symbol__annotate_printf(struct symbol *sym, struct map *map, int evidx, int more = 0; u64 len; + filename = strdup(dso->long_name); + if (!filename) + return -ENOMEM; + if (full_paths) d_filename = filename; else @@ -1042,6 +1047,8 @@ int symbol__annotate_printf(struct symbol *sym, struct map *map, int evidx, } } + free(filename); + return more; }