Skip to content

Commit d0f6370

Browse files
committed
Properly close shm->segment
1 parent 470ab93 commit d0f6370

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

TSRM/tsrm_win32.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,7 @@ TSRM_API int shmget(key_t key, size_t size, int flags)
658658
shm->descriptor = MapViewOfFileEx(shm->segment, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL);
659659
if (shm->descriptor == NULL) {
660660
SET_ERRNO_FROM_WIN32_CODE(GetLastError());
661+
CloseHandle(shm->segment);
661662
return -1;
662663
}
663664

0 commit comments

Comments
 (0)