]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - tools/perf/builtin-record.c
perf record: Zero out mmap_array to fix segfault
[net-next-2.6.git] / tools / perf / builtin-record.c
index bb5b23db4239802b9281a9b131f7717ceeffe3ad..60ecdd3dd26dd9457e4464c1138803482072d62a 100644 (file)
@@ -751,7 +751,7 @@ int cmd_record(int argc, const char **argv, const char *prefix __used)
        for (i = 0; i < MAX_NR_CPUS; i++) {
                for (j = 0; j < MAX_COUNTERS; j++) {
                        fd[i][j] = malloc(sizeof(int)*thread_num);
-                       mmap_array[i][j] = malloc(
+                       mmap_array[i][j] = zalloc(
                                sizeof(struct mmap_data)*thread_num);
                        if (!fd[i][j] || !mmap_array[i][j])
                                return -ENOMEM;