summaryrefslogtreecommitdiff
path: root/libs/pthreads/src/pthread_mutex_trylock.c
diff options
context:
space:
mode:
Diffstat (limited to 'libs/pthreads/src/pthread_mutex_trylock.c')
-rw-r--r--libs/pthreads/src/pthread_mutex_trylock.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/pthreads/src/pthread_mutex_trylock.c b/libs/pthreads/src/pthread_mutex_trylock.c
index d6b68724db..5728728b62 100644
--- a/libs/pthreads/src/pthread_mutex_trylock.c
+++ b/libs/pthreads/src/pthread_mutex_trylock.c
@@ -64,6 +64,10 @@ pthread_mutex_trylock (pthread_mutex_t * mutex)
}
mx = *mutex;
+ if (mx == NULL) {
+ return EINVAL;
+ }
+
kind = mx->kind;
if (kind >= 0)