Fix tests: use of uninitialized variables
[urcu.git] / tests / test_urcu_wfq.c
index db00d8c77c36f1d73dfa7cc57ddb4c9ce958d488..382a1f6f38abb54926b1d0d0a563ca6564999f01 100644 (file)
@@ -322,10 +322,10 @@ int main(int argc, char **argv)
        printf_verbose("thread %-6s, tid %lu\n",
                        "main", urcu_get_thread_id());
 
-       tid_enqueuer = malloc(sizeof(*tid_enqueuer) * nr_enqueuers);
-       tid_dequeuer = malloc(sizeof(*tid_dequeuer) * nr_dequeuers);
-       count_enqueuer = malloc(2 * sizeof(*count_enqueuer) * nr_enqueuers);
-       count_dequeuer = malloc(2 * sizeof(*count_dequeuer) * nr_dequeuers);
+       tid_enqueuer = calloc(nr_enqueuers, sizeof(*tid_enqueuer));
+       tid_dequeuer = calloc(nr_dequeuers, sizeof(*tid_dequeuer));
+       count_enqueuer = calloc(nr_enqueuers, 2 * sizeof(*count_enqueuer));
+       count_dequeuer = calloc(nr_dequeuers, 2 * sizeof(*count_dequeuer));
        cds_wfq_init(&q);
 
        next_aff = 0;
This page took 0.03067 seconds and 4 git commands to generate.