Skip to content

Commit

Permalink
Whoops, DosCloseMutexSem() needs to free memory we previously allocated.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Sep 15, 2017
1 parent ceb7900 commit 9344897
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions native/doscalls.c
Expand Up @@ -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
Expand Down

0 comments on commit 9344897

Please sign in to comment.