X-Git-Url: https://git.lttng.org/?p=urcu.git;a=blobdiff_plain;f=tests%2Ftest_rwlock.c;h=5a0e8c190410c7e2402cc411f650f4a1ee740cd4;hp=287b14eda2aeabcf3e5689d0857e00cee6971b5c;hb=9aa14175d93952464fa8ec15df54e2656c349c0b;hpb=94df63189704b8f6483c737988df3728f5e13c2d diff --git a/tests/test_rwlock.c b/tests/test_rwlock.c index 287b14e..5a0e8c1 100644 --- a/tests/test_rwlock.c +++ b/tests/test_rwlock.c @@ -333,10 +333,10 @@ int main(int argc, char **argv) printf_verbose("thread %-6s, tid %lu\n", "main", urcu_get_thread_id()); - tid_reader = malloc(sizeof(*tid_reader) * nr_readers); - tid_writer = malloc(sizeof(*tid_writer) * nr_writers); - count_reader = malloc(sizeof(*count_reader) * nr_readers); - count_writer = malloc(sizeof(*count_writer) * nr_writers); + tid_reader = calloc(nr_readers, sizeof(*tid_reader)); + tid_writer = calloc(nr_writers, sizeof(*tid_writer)); + count_reader = calloc(nr_readers, sizeof(*count_reader)); + count_writer = calloc(nr_writers, sizeof(*count_writer)); next_aff = 0;