diff options
author | Neal H. Walfield <neal@gnu.org> | 2008-12-11 16:46:31 +0100 |
---|---|---|
committer | Neal H. Walfield <neal@gnu.org> | 2008-12-11 16:46:31 +0100 |
commit | 335bbeaccabaecdc07e92dae91c8d9284e708c90 (patch) | |
tree | 327ec4a86f31e1bf1a0aea789ed4f9116e0e82ce /libpthread | |
parent | 8560dd4d462e064c8050000d909d431ff0853b7b (diff) |
Use calloc, not malloc, to allocate a new struct __pthread.
2008-12-11 Neal H. Walfield <neal@gnu.org>
* pthread/pt-alloc.c (__pthread_alloc): Use calloc, not malloc, to
allocate a new struct __pthread.
Diffstat (limited to 'libpthread')
-rw-r--r-- | libpthread/ChangeLog | 5 | ||||
-rw-r--r-- | libpthread/pthread/pt-alloc.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/libpthread/ChangeLog b/libpthread/ChangeLog index 7545033..8942404 100644 --- a/libpthread/ChangeLog +++ b/libpthread/ChangeLog @@ -1,3 +1,8 @@ +2008-12-11 Neal H. Walfield <neal@gnu.org> + + * pthread/pt-alloc.c (__pthread_alloc): Use calloc, not malloc, to + allocate a new struct __pthread. + 2008-11-03 Neal H. Walfield <neal@gnu.org> * headers.m4: Don't create an empty libpthread/libpthread.a. diff --git a/libpthread/pthread/pt-alloc.c b/libpthread/pthread/pt-alloc.c index 6af2da9..c63801f 100644 --- a/libpthread/pthread/pt-alloc.c +++ b/libpthread/pthread/pt-alloc.c @@ -123,7 +123,7 @@ __pthread_alloc (struct __pthread **pthread) } /* Allocate a new thread structure. */ - new = malloc (sizeof (struct __pthread)); + new = calloc (sizeof (struct __pthread), 1); if (new == NULL) return ENOMEM; |