summaryrefslogtreecommitdiff
path: root/Python/thread_pthread.h
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2005-09-20 18:07:47 +0000
committerArmin Rigo <arigo@tunes.org>2005-09-20 18:07:47 +0000
commita6eb56cf4672cedb813af1c228df14d1d2208c7a (patch)
tree4da3b4a41688de2c5bdce8e0c225f682e8895da2 /Python/thread_pthread.h
parentb53355ad773723aa9f9ac4d70f21010a80e07d62 (diff)
downloadcpython-git-a6eb56cf4672cedb813af1c228df14d1d2208c7a.tar.gz
Don't call memset() before checking that the ptr is not NULL.
Diffstat (limited to 'Python/thread_pthread.h')
-rw-r--r--Python/thread_pthread.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h
index a415a434be..781467f84b 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,