From a6eb56cf4672cedb813af1c228df14d1d2208c7a Mon Sep 17 00:00:00 2001 From: Armin Rigo Date: Tue, 20 Sep 2005 18:07:47 +0000 Subject: [PATCH] Don't call memset() before checking that the ptr is not NULL. --- Python/thread_pthread.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h index a415a434bee8..781467f84bed 100644 --- a/Python/thread_pthread.h +++ b/Python/thread_pthread.h @@ -355,8 +355,8 @@ PyThread_allocate_lock(void) PyThread_init_thread(); lock = (pthread_lock *) malloc(sizeof(pthread_lock)); - memset((void *)lock, '\0', sizeof(pthread_lock)); if (lock) { + memset((void *)lock, '\0', sizeof(pthread_lock)); lock->locked = 0; status = pthread_mutex_init(&lock->mut, -- 2.47.3