From 7668a8bc93c2bd573716d1bea0f52ea520502b28 Mon Sep 17 00:00:00 2001 From: Andy Lester Date: Tue, 24 Mar 2020 23:26:44 -0500 Subject: Use calloc-based functions, not malloc. (GH-19152) --- Python/thread_pthread.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Python/thread_pthread.h') diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h index ff4266c72b..40e2e117a2 100644 --- a/Python/thread_pthread.h +++ b/Python/thread_pthread.h @@ -547,9 +547,8 @@ PyThread_allocate_lock(void) if (!initialized) PyThread_init_thread(); - lock = (pthread_lock *) PyMem_RawMalloc(sizeof(pthread_lock)); + lock = (pthread_lock *) PyMem_RawCalloc(1, sizeof(pthread_lock)); if (lock) { - memset((void *)lock, '\0', sizeof(pthread_lock)); lock->locked = 0; status = pthread_mutex_init(&lock->mut, NULL); -- cgit v1.2.1