diff Python/thread_pthread.h @ 35607:5a8bf8e7d010 legacy-trunk

Don't call memset() before checking that the ptr is not NULL.
author Armin Rigo <arigo@tunes.org>
date Tue, 20 Sep 2005 18:07:47 +0000
parents a50ffe65911b
children 4f97b6a229ce
line wrap: on
line diff
--- a/Python/thread_pthread.h	Tue Sep 20 15:13:53 2005 +0000
+++ b/Python/thread_pthread.h	Tue Sep 20 18:07:47 2005 +0000
@@ -355,8 +355,8 @@
 		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,