Skip to content

Commit

Permalink
perf tools: Fix buffer allocation
Browse files Browse the repository at this point in the history
"perf top" cores dump on my dev machine, if run from a directory
where vmlinux is present:

  *** glibc detected *** malloc(): memory corruption: 0x085670d0 ***

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: <stable@kernel.org>
LKML-Reference: <4ABB6EB7.7000002@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Eric Dumazet authored and Ingo Molnar committed Sep 24, 2009
1 parent 6703003 commit a255a99
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/perf/util/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ static int mod_dso__load_module_paths(struct mod_dso *self)
len += strlen(uts.release);
len += strlen("/modules.dep");

dpath = calloc(1, len);
dpath = calloc(1, len + 1);
if (dpath == NULL)
return err;

Expand Down

0 comments on commit a255a99

Please sign in to comment.