[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-44ad6b8852529eb39066edbedc027a6901da6803@git.kernel.org>
Date: Thu, 8 Jun 2017 15:50:05 -0700
From: tip-bot for Namhyung Kim <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: hpa@...or.com, linux-kernel@...r.kernel.org,
adrian.hunter@...el.com, namhyung@...nel.org, acme@...hat.com,
mingo@...nel.org, wangnan0@...wei.com, tglx@...utronix.de,
a.p.zijlstra@...llo.nl, jolsa@...nel.org, dsahern@...il.com
Subject: [tip:perf/urgent] perf tools: Fix a memory leak in __open_dso()
Commit-ID: 44ad6b8852529eb39066edbedc027a6901da6803
Gitweb: http://git.kernel.org/tip/44ad6b8852529eb39066edbedc027a6901da6803
Author: Namhyung Kim <namhyung@...nel.org>
AuthorDate: Thu, 8 Jun 2017 16:31:02 +0900
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Thu, 8 Jun 2017 15:38:47 -0300
perf tools: Fix a memory leak in __open_dso()
The 'name' variable should be freed on the error path.
Signed-off-by: Namhyung Kim <namhyung@...nel.org>
Acked-by: Jiri Olsa <jolsa@...nel.org>
Cc: Adrian Hunter <adrian.hunter@...el.com>
Cc: David Ahern <dsahern@...il.com>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Wang Nan <wangnan0@...wei.com>
Cc: kernel-team@....com
Link: http://lkml.kernel.org/r/20170608073109.30699-3-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/util/dso.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index b27d127..1f29e4f 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -412,8 +412,10 @@ static int __open_dso(struct dso *dso, struct machine *machine)
return -EINVAL;
}
- if (!is_regular_file(name))
+ if (!is_regular_file(name)) {
+ free(name);
return -EINVAL;
+ }
fd = do_open(name);
free(name);
Powered by blists - more mailing lists