summaryrefslogtreecommitdiffstats
path: root/lib/libkse/thread/thr_rtld.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libkse/thread/thr_rtld.c')
-rw-r--r--lib/libkse/thread/thr_rtld.c12
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);
}
OpenPOWER on IntegriCloud