From 93448975c24d20be9836c7fc7b51eed4a359e9ad Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Fri, 15 Sep 2017 10:49:26 -0400 Subject: [PATCH] Whoops, DosCloseMutexSem() needs to free memory we previously allocated. --- native/doscalls.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/native/doscalls.c b/native/doscalls.c index 65b303d..9498bc5 100644 --- a/native/doscalls.c +++ b/native/doscalls.c @@ -3004,11 +3004,13 @@ APIRET DosCloseMutexSem(HMTX hmtx) if (hmtx) { pthread_mutex_t *mutex = (pthread_mutex_t *) hmtx; const int rc = pthread_mutex_destroy(mutex); - if (rc == 0) - return NO_ERROR; - else if (rc == EBUSY) + if (rc == EBUSY) { return ERROR_SEM_BUSY; - } + } else if (rc == 0) { + free(mutex); + return NO_ERROR; + } // else if + } // if return ERROR_INVALID_HANDLE; } // DosCloseMutexSem