Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 234023
b: refs/heads/master
c: 7ee235e
h: refs/heads/master
i:
  234021: fb2ce58
  234019: 10de3b7
  234015: 098f725
v: v3
  • Loading branch information
Lin Ming authored and Arnaldo Carvalho de Melo committed Mar 9, 2011
1 parent 8368daf commit 40cb6e8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a639dc64e52183a361c260e562e73b0800b89072
refs/heads/master: 7ee235efe5f86f239ce73915fd2e15f4d14259c6
11 changes: 8 additions & 3 deletions trunk/tools/perf/util/header.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,15 @@ int build_id_cache__add_s(const char *sbuild_id, const char *debugdir,
const char *name, bool is_kallsyms)
{
const size_t size = PATH_MAX;
char *realname = realpath(name, NULL),
*filename = malloc(size),
char *realname, *filename = malloc(size),
*linkname = malloc(size), *targetname;
int len, err = -1;

if (is_kallsyms)
realname = (char *)name;
else
realname = realpath(name, NULL);

if (realname == NULL || filename == NULL || linkname == NULL)
goto out_free;

Expand Down Expand Up @@ -306,7 +310,8 @@ int build_id_cache__add_s(const char *sbuild_id, const char *debugdir,
if (symlink(targetname, linkname) == 0)
err = 0;
out_free:
free(realname);
if (!is_kallsyms)
free(realname);
free(filename);
free(linkname);
return err;
Expand Down

0 comments on commit 40cb6e8

Please sign in to comment.