userspace-rcu tests: zero array before using
[urcu.git] / tests / test_qsbr.c
index 1ef8c265895025a51021bf005b25eedeae546f98..99da27c6a97564c5c015ee34b08174cd99ccde28 100644 (file)
@@ -403,7 +403,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.022195 seconds and 4 git commands to generate.