Don't call memset() before checking that the ptr is not NULL.

This commit is contained in:
Armin Rigo 2005-09-20 18:07:47 +00:00
parent b53355ad77
commit a6eb56cf46

View file

@ -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,