提交 164c800e 编写于 作者: D David Ahern 提交者: Arnaldo Carvalho de Melo

perf symbols: Move name malloc to when needed in dso__load

Memory is currently leaked on some paths.
Signed-off-by: NDavid Ahern <dsahern@gmail.com>
Link: http://lkml.kernel.org/r/1358185607-90799-1-git-send-email-dsahern@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 9811360e
...@@ -768,10 +768,6 @@ int dso__load(struct dso *dso, struct map *map, symbol_filter_t filter) ...@@ -768,10 +768,6 @@ int dso__load(struct dso *dso, struct map *map, symbol_filter_t filter)
else else
machine = NULL; machine = NULL;
name = malloc(PATH_MAX);
if (!name)
return -1;
dso->adjust_symbols = 0; dso->adjust_symbols = 0;
if (strncmp(dso->name, "/tmp/perf-", 10) == 0) { if (strncmp(dso->name, "/tmp/perf-", 10) == 0) {
...@@ -795,6 +791,10 @@ int dso__load(struct dso *dso, struct map *map, symbol_filter_t filter) ...@@ -795,6 +791,10 @@ int dso__load(struct dso *dso, struct map *map, symbol_filter_t filter)
if (machine) if (machine)
root_dir = machine->root_dir; root_dir = machine->root_dir;
name = malloc(PATH_MAX);
if (!name)
return -1;
/* Iterate over candidate debug images. /* Iterate over candidate debug images.
* Keep track of "interesting" ones (those which have a symtab, dynsym, * Keep track of "interesting" ones (those which have a symtab, dynsym,
* and/or opd section) for processing. * and/or opd section) for processing.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册