Skip to content

Commit

Permalink
perf header: Fix memory leak for the "Not caching a kptr_restrict'ed …
Browse files Browse the repository at this point in the history
…/proc/kallsyms" case

cppcheck reported:
[util/header.c:316]: (error) Memory leak: filename
[util/header.c:316]: (error) Memory leak: linkname

Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
Link: http://lkml.kernel.org/r/9377388.0eFDp53iW6@storm
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Thomas Jarosch authored and Arnaldo Carvalho de Melo committed Jan 30, 2013
1 parent 0b9e01a commit fdae637
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/perf/util/header.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,8 @@ int build_id_cache__add_s(const char *sbuild_id, const char *debugdir,
if (is_kallsyms) {
if (symbol_conf.kptr_restrict) {
pr_debug("Not caching a kptr_restrict'ed /proc/kallsyms\n");
return 0;
err = 0;
goto out_free;
}
realname = (char *) name;
} else
Expand Down

0 comments on commit fdae637

Please sign in to comment.