diff options
Diffstat (limited to 'lib/libthr/thread/thr_exit.c')
-rw-r--r-- | lib/libthr/thread/thr_exit.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/libthr/thread/thr_exit.c b/lib/libthr/thread/thr_exit.c index facd707..41b1f86 100644 --- a/lib/libthr/thread/thr_exit.c +++ b/lib/libthr/thread/thr_exit.c @@ -122,6 +122,12 @@ _pthread_exit(void *status) _thread_cleanupspecific(); } + /* + * Remove read-write lock list. It is allocated as-needed. + * Therefore, it must be checked for validity before freeing. + */ + if (curthread->rwlockList != NULL) + free(curthread->rwlockList); retry: /* * Proper lock order, to minimize deadlocks, between joining |