|
@@ -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;
|
|
|
}
|
|
|
|