aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKartik Naik <kartik@bugqore.com>2026-08-08 17:37:40 +0530
committerKartik Naik <kartik@bugqore.com>2026-08-08 17:37:40 +0530
commit2489ccf3d8af2299866276b4c58741a345a16d13 (patch)
tree6cedb86791c3066392da474b740f77c46a9140df /include
parent8430c1d169b83d5bfef4651e4bdacc8925dce2d1 (diff)
downloadportable-2489ccf3d8af2299866276b4c58741a345a16d13.tar.gz
portable-2489ccf3d8af2299866276b4c58741a345a16d13.tar.bz2
portable-2489ccf3d8af2299866276b4c58741a345a16d13.zip
fix double free of lock in pthread_mutex_destroy
Diffstat (limited to 'include')
-rw-r--r--include/compat/pthread.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/compat/pthread.h b/include/compat/pthread.h
index 8211dda..7702dcd 100644
--- a/include/compat/pthread.h
+++ b/include/compat/pthread.h
@@ -110,8 +110,11 @@ pthread_mutex_unlock(pthread_mutex_t *mutex)
110static inline int 110static inline int
111pthread_mutex_destroy(pthread_mutex_t *mutex) 111pthread_mutex_destroy(pthread_mutex_t *mutex)
112{ 112{
113 DeleteCriticalSection(mutex->lock); 113 if (mutex->lock != NULL) {
114 free(mutex->lock); 114 DeleteCriticalSection(mutex->lock);
115 free(mutex->lock);
116 mutex->lock = NULL;
117 }
115 return 0; 118 return 0;
116} 119}
117 120