mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
evthread: fix NULL dereference in evthread_setup_global_lock_()
This commit is contained in:
parent
2f27523e44
commit
6e4ea6c3f1
@ -402,8 +402,9 @@ evthread_setup_global_lock_(void *lock_, unsigned locktype, int enable_locks)
|
||||
} else {
|
||||
/* Case 4: Fill in a debug lock with a real lock */
|
||||
struct debug_lock *lock = lock_ ? lock_ : debug_lock_alloc(locktype);
|
||||
EVUTIL_ASSERT(enable_locks &&
|
||||
evthread_lock_debugging_enabled_);
|
||||
if (!lock)
|
||||
return NULL;
|
||||
EVUTIL_ASSERT(enable_locks && evthread_lock_debugging_enabled_);
|
||||
EVUTIL_ASSERT(lock->locktype == locktype);
|
||||
if (!lock->lock) {
|
||||
lock->lock = original_lock_fns_.alloc(
|
||||
|
Loading…
x
Reference in New Issue
Block a user