From: Masanari Iida Date: Sat, 19 Apr 2014 15:16:41 +0000 (+0900) Subject: perf tests x86: Fix memory leak in sample_ustack() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=763d7f5f2718f085bab5a9e63308349728f3ad12;p=openwrt%2Fstaging%2Fblogic.git perf tests x86: Fix memory leak in sample_ustack() The buf is not freed, when kernel failed to get stack map and return. Signed-off-by: Masanari Iida Link: http://lkml.kernel.org/r/1398091024-7901-1-git-send-email-standby24x7@gmail.com Signed-off-by: Jiri Olsa --- diff --git a/tools/perf/arch/x86/tests/dwarf-unwind.c b/tools/perf/arch/x86/tests/dwarf-unwind.c index b602ad93ce63..b8c0102c70c8 100644 --- a/tools/perf/arch/x86/tests/dwarf-unwind.c +++ b/tools/perf/arch/x86/tests/dwarf-unwind.c @@ -26,6 +26,7 @@ static int sample_ustack(struct perf_sample *sample, map = map_groups__find(&thread->mg, MAP__FUNCTION, (u64) sp); if (!map) { pr_debug("failed to get stack map\n"); + free(buf); return -1; }