diff options
author | deischen <deischen@FreeBSD.org> | 2005-08-29 13:47:42 +0000 |
---|---|---|
committer | deischen <deischen@FreeBSD.org> | 2005-08-29 13:47:42 +0000 |
commit | edebe2a2bd14afa5413045efa67c0163afc57a02 (patch) | |
tree | 9b02283d205318431f8306bc294216256da7c709 /lib/libkse/thread/thr_rtld.c | |
parent | e8b11bb2ef203a9c1e215689e011a8f46a73a331 (diff) | |
download | FreeBSD-src-edebe2a2bd14afa5413045efa67c0163afc57a02.zip FreeBSD-src-edebe2a2bd14afa5413045efa67c0163afc57a02.tar.gz |
Don't attempt to initialize the rtld lock if it can't be malloc()'d.
PR: 83452
Diffstat (limited to 'lib/libkse/thread/thr_rtld.c')
-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); } |