From 99b3a9ab2a0906363706e26cf3be0780908d299a Mon Sep 17 00:00:00 2001 From: Jeff Mahoney Date: Mon, 20 Jan 2014 13:28:27 +1100 Subject: [PATCH] aio-stress: use calloc for thread_info array The thread_info array is assumed to be initialized to 0s, but that causes a segfault when MALLOC_PERTURB_ is set. Signed-off-by: Jeff Mahoney Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner --- ltp/aio-stress.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ltp/aio-stress.c b/ltp/aio-stress.c index ebff1bd4..d08843a8 100644 --- a/ltp/aio-stress.c +++ b/ltp/aio-stress.c @@ -1413,9 +1413,9 @@ int main(int ac, char **av) num_threads); } - t = malloc(num_threads * sizeof(*t)); + t = calloc(num_threads, sizeof(*t)); if (!t) { - perror("malloc"); + perror("calloc"); exit(1); } global_thread_info = t; -- 2.47.3