mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
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 <jeffm@suse.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <dchinner@redhat.com>
This commit is contained in:
committed by
Dave Chinner
parent
5aafebc5fd
commit
99b3a9ab2a
+2
-2
@@ -1413,9 +1413,9 @@ int main(int ac, char **av)
|
|||||||
num_threads);
|
num_threads);
|
||||||
}
|
}
|
||||||
|
|
||||||
t = malloc(num_threads * sizeof(*t));
|
t = calloc(num_threads, sizeof(*t));
|
||||||
if (!t) {
|
if (!t) {
|
||||||
perror("malloc");
|
perror("calloc");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
global_thread_info = t;
|
global_thread_info = t;
|
||||||
|
|||||||
Reference in New Issue
Block a user