Fix memory leak for the "Not caching a kptr_restrict'ed /proc/kallsyms\n" case
PATCH 2/3 Fix memory leak for the "Not caching a kptr_restrict'ed /proc/kallsyms\n" case
cppcheck reported:
[util/header.c:316]: (error) Memory leak: filename [util/header.c:316]: (error) Memory leak: linkname
Signed-off-by Thomas Jarosch <[email protected]>
--- tools/perf/util/header.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tools/perf/util/header.c +2 -1
@@ -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
Signature · 1 line
1.7.11.7
[tip:perf/core] perf header: Fix memory leak for the " Not caching a kptr_restrict'ed /proc/kallsyms" case
Commit-ID: fdae6373910c10e27b8ae07e11e821b183d0bba5 Gitweb: http://git.kernel.org/tip/fdae6373910c10e27b8ae07e11e821b183d0bba5 Author: Thomas Jarosch <[email protected]> AuthorDate: Fri, 25 Jan 2013 11:21:39 +0100 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 30 Jan 2013 10:40:18 -0300
perf header: Fix memory leak for the "Not caching a kptr_restrict'ed /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 <[email protected]>
Signed-off-by Arnaldo Carvalho de Melo <[email protected]>
--- tools/perf/util/header.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tools/perf/util/header.c +2 -1
@@ -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