Use calloc-based functions, not malloc. (GH-19152)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user