diff options
author | 2006-04-02 21:38:55 +0000 | |
---|---|---|
committer | 2006-04-02 21:38:55 +0000 | |
commit | ad4287e4204c02b0e79cb4b7bbcb41e8bc21ac49 (patch) | |
tree | f8d1e648b70424b1586a748392751de1ee7a0269 /lib/libpthread/uthread | |
parent | some characters are in fact allowed in symbol names, don't freak (diff) | |
download | wireguard-openbsd-ad4287e4204c02b0e79cb4b7bbcb41e8bc21ac49.tar.xz wireguard-openbsd-ad4287e4204c02b0e79cb4b7bbcb41e8bc21ac49.zip |
malloc(x * y) -> calloc(x, y) from adobriyan AT gmail.com, with tweaks
suggested by kjell@; ok otto@ pat@ millert@ jaredy@
Diffstat (limited to 'lib/libpthread/uthread')
-rw-r--r-- | lib/libpthread/uthread/uthread_spec.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/libpthread/uthread/uthread_spec.c b/lib/libpthread/uthread/uthread_spec.c index b1fdeb9dfa5..41f66a7e1ac 100644 --- a/lib/libpthread/uthread/uthread_spec.c +++ b/lib/libpthread/uthread/uthread_spec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uthread_spec.c,v 1.7 2001/08/21 19:24:53 fgsch Exp $ */ +/* $OpenBSD: uthread_spec.c,v 1.8 2006/04/02 21:38:57 djm Exp $ */ /* * Copyright (c) 1995 John Birrell <jb@cimlogic.com.au>. * All rights reserved. @@ -134,11 +134,7 @@ _thread_cleanupspecific(void) static inline const void ** pthread_key_allocate_data(void) { - const void **new_data; - if ((new_data = (const void **) malloc(sizeof(void *) * PTHREAD_KEYS_MAX)) != NULL) { - memset((void *) new_data, 0, sizeof(void *) * PTHREAD_KEYS_MAX); - } - return (new_data); + return calloc(PTHREAD_KEYS_MAX, sizeof(void *)); } int |