Skip to content

Commit

Permalink
perf tests x86: Fix memory leak in sample_ustack()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
standby24x7 authored and Jiri Olsa committed Apr 23, 2014
1 parent fd741ed commit 763d7f5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tools/perf/arch/x86/tests/dwarf-unwind.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 763d7f5

Please sign in to comment.