aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMasanari Iida2014-04-19 10:16:41 -0500
committerJiri Olsa2014-04-23 06:19:01 -0500
commit763d7f5f2718f085bab5a9e63308349728f3ad12 (patch)
treee38efec4d2bf05e2c43a40f1b005017f85d0c935 /tools
parentfd741edc25600e1660abd00b5c1bbe967018c6a0 (diff)
downloadlinux-phy-763d7f5f2718f085bab5a9e63308349728f3ad12.tar.gz
linux-phy-763d7f5f2718f085bab5a9e63308349728f3ad12.tar.xz
linux-phy-763d7f5f2718f085bab5a9e63308349728f3ad12.zip
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 <standby24x7@gmail.com> Link: http://lkml.kernel.org/r/1398091024-7901-1-git-send-email-standby24x7@gmail.com Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/arch/x86/tests/dwarf-unwind.c1
1 files changed, 1 insertions, 0 deletions
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,
26 map = map_groups__find(&thread->mg, MAP__FUNCTION, (u64) sp); 26 map = map_groups__find(&thread->mg, MAP__FUNCTION, (u64) sp);
27 if (!map) { 27 if (!map) {
28 pr_debug("failed to get stack map\n"); 28 pr_debug("failed to get stack map\n");
29 free(buf);
29 return -1; 30 return -1;
30 } 31 }
31 32