aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBrent Cook <busterb@gmail.com>2021-02-28 10:04:51 -0600
committerBrent Cook <busterb@gmail.com>2021-02-28 10:04:51 -0600
commit90f1c4db5c2d4bfd42882b89495409d3eb1e1ed1 (patch)
treee9be67849be6ecdc92d441831f44081be45b6ef3 /include
parent81e17c73485ce979ff443004b19b6c608f489905 (diff)
downloadportable-90f1c4db5c2d4bfd42882b89495409d3eb1e1ed1.tar.gz
portable-90f1c4db5c2d4bfd42882b89495409d3eb1e1ed1.tar.bz2
portable-90f1c4db5c2d4bfd42882b89495409d3eb1e1ed1.zip
fix leak in Windows version of pthread_mutex_free
Free the lock pointer in addition to the critical section. Thanks to martinkucera74 on github.
Diffstat (limited to 'include')
-rwxr-xr-xinclude/compat/pthread.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/compat/pthread.h b/include/compat/pthread.h
index 223ad83..1ab011c 100755
--- a/include/compat/pthread.h
+++ b/include/compat/pthread.h
@@ -106,6 +106,7 @@ static inline int
106pthread_mutex_destroy(pthread_mutex_t *mutex) 106pthread_mutex_destroy(pthread_mutex_t *mutex)
107{ 107{
108 DeleteCriticalSection(mutex->lock); 108 DeleteCriticalSection(mutex->lock);
109 free(mutex->lock);
109 return 0; 110 return 0;
110} 111}
111 112