diff options
-rw-r--r-- | lib/libstdthreads/thrd.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libstdthreads/thrd.c b/lib/libstdthreads/thrd.c index f0ce55a..b0e36ef 100644 --- a/lib/libstdthreads/thrd.c +++ b/lib/libstdthreads/thrd.c @@ -108,7 +108,8 @@ thrd_join(thrd_t thr, int *res) if (pthread_join(thr, &value_ptr) != 0) return (thrd_error); - *res = (intptr_t)value_ptr; + if (res != NULL) + *res = (intptr_t)value_ptr; return (thrd_success); } |