提交 eb47cb2e 编写于 作者: M Masami Hiramatsu 提交者: Arnaldo Carvalho de Melo

perf probe: Fix get_real_path to free allocated memory in error path

Fix get_real_path to free allocated memory when comp_dir is used for
complementing path and getting an error.
Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Naohiro Aota <naota@elisp.net>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20150226082504.28125.74506.stgit@localhost.localdomainSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 9aaf5a5f
......@@ -549,9 +549,11 @@ static int get_real_path(const char *raw_path, const char *comp_dir,
if (access(*new_path, R_OK) == 0)
return 0;
if (!symbol_conf.source_prefix)
if (!symbol_conf.source_prefix) {
/* In case of searching comp_dir, don't retry */
zfree(new_path);
return -errno;
}
switch (errno) {
case ENAMETOOLONG:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册