diff options
Diffstat (limited to 'lib/libkse/thread')
-rw-r--r-- | lib/libkse/thread/thr_rtld.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/libkse/thread/thr_rtld.c b/lib/libkse/thread/thr_rtld.c index 9528593..e813073 100644 --- a/lib/libkse/thread/thr_rtld.c +++ b/lib/libkse/thread/thr_rtld.c @@ -160,11 +160,13 @@ _thr_rtld_lock_create(void) { struct rtld_kse_lock *l; - l = malloc(sizeof(struct rtld_kse_lock)); - _lock_init(&l->lck, LCK_ADAPTIVE, _kse_lock_wait, _kse_lock_wakeup); - l->owner = NULL; - l->count = 0; - l->write = 0; + if ((l = malloc(sizeof(struct rtld_kse_lock))) != NULL) { + _lock_init(&l->lck, LCK_ADAPTIVE, _kse_lock_wait, + _kse_lock_wakeup); + l->owner = NULL; + l->count = 0; + l->write = 0; + } return (l); } |