diff options
| author | Brent Cook <busterb@gmail.com> | 2021-02-28 10:04:51 -0600 |
|---|---|---|
| committer | Brent Cook <busterb@gmail.com> | 2021-02-28 10:04:51 -0600 |
| commit | 90f1c4db5c2d4bfd42882b89495409d3eb1e1ed1 (patch) | |
| tree | e9be67849be6ecdc92d441831f44081be45b6ef3 /include | |
| parent | 81e17c73485ce979ff443004b19b6c608f489905 (diff) | |
| download | portable-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-x | include/compat/pthread.h | 1 |
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 | |||
| 106 | pthread_mutex_destroy(pthread_mutex_t *mutex) | 106 | pthread_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 | ||
