summaryrefslogtreecommitdiffstats
path: root/Python/thread_pthread.h
diff options
context:
space:
mode:
authorAndy Lester <andy@petdance.com>2020-03-25 04:26:44 (GMT)
committerGitHub <noreply@github.com>2020-03-25 04:26:44 (GMT)
commit7668a8bc93c2bd573716d1bea0f52ea520502b28 (patch)
tree0c6dce63a06466c3f9136df09f5cd928d20e5c55 /Python/thread_pthread.h
parent7dd549eb08939e1927fba818116f5202e76f8d73 (diff)
downloadcpython-7668a8bc93c2bd573716d1bea0f52ea520502b28.zip
cpython-7668a8bc93c2bd573716d1bea0f52ea520502b28.tar.gz
cpython-7668a8bc93c2bd573716d1bea0f52ea520502b28.tar.bz2
Use calloc-based functions, not malloc. (GH-19152)
Diffstat (limited to 'Python/thread_pthread.h')
-rw-r--r--Python/thread_pthread.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h
index ff4266c..40e2e11 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);