userspace-rcu tests: zero array before using
[urcu.git] / tests / test_urcu.c
index e6a648981ed8b6b5a0abb679771d98d5e695dd9b..bbdb2d8f4ac33abe82aa23ce6a8844a2db179b89 100644 (file)
@@ -400,7 +400,7 @@ int main(int argc, char **argv)
        printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
                        "main", pthread_self(), (unsigned long)gettid());
 
-       test_array = malloc(sizeof(*test_array) * ARRAY_SIZE);
+       test_array = calloc(1, sizeof(*test_array) * ARRAY_SIZE);
        tid_reader = malloc(sizeof(*tid_reader) * nr_readers);
        tid_writer = malloc(sizeof(*tid_writer) * nr_writers);
        count_reader = malloc(sizeof(*count_reader) * nr_readers);
This page took 0.022591 seconds and 4 git commands to generate.