Kaydet (Commit) a6eb56cf authored tarafından Armin Rigo's avatar Armin Rigo

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

üst b53355ad
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment