userspace-rcu tests: zero array before using
[urcu.git] / tests / test_urcu_assign.c
index 24a704b242583de6f6894b4d534426124d4f9aa9..a73fc23892aa37961de60c409d6b2dbae0d11d49 100644 (file)
@@ -399,7 +399,7 @@ int main(int argc, char **argv)
        printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
                        "main", pthread_self(), (unsigned long)gettid());
 
        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);
        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.023188 seconds and 4 git commands to generate.