From: Armin Rigo Date: Tue, 20 Sep 2005 18:07:47 +0000 (+0000) Subject: Don't call memset() before checking that the ptr is not NULL. X-Git-Tag: v2.5a0~1355 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a6eb56cf4672cedb813af1c228df14d1d2208c7a;p=thirdparty%2FPython%2Fcpython.git Don't call memset() before checking that the ptr is not NULL. --- 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,