aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2009-09-24 09:05:59 -0400
committerIngo Molnar <mingo@elte.hu>2009-09-24 09:11:23 -0400
commita255a9981a8566a1efabec983b7811e937e662d2 (patch)
treea445c70426192ab086cb1a1fb7f704fe58442cc2 /tools
parent67030036ebb370b0aa5561ae2fe31668ed1ccd1c (diff)
perf tools: Fix buffer allocation
"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>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/util/module.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/module.c b/tools/perf/util/module.c
index 8f81622073e..0d8c85defcd 100644
--- a/tools/perf/util/module.c
+++ b/tools/perf/util/module.c
@@ -423,7 +423,7 @@ static int mod_dso__load_module_paths(struct mod_dso *self)
423 len += strlen(uts.release); 423 len += strlen(uts.release);
424 len += strlen("/modules.dep"); 424 len += strlen("/modules.dep");
425 425
426 dpath = calloc(1, len); 426 dpath = calloc(1, len + 1);
427 if (dpath == NULL) 427 if (dpath == NULL)
428 return err; 428 return err;
429 429