From d5bd999a8f33144ffbd19d5d45ba078dc77242da Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Sun, 4 Oct 2015 22:19:51 +0200 Subject: don't leak handles --- TSRM/tsrm_win32.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'TSRM') diff --git a/TSRM/tsrm_win32.c b/TSRM/tsrm_win32.c index 5b8b64a1e1..9f900f2ae6 100644 --- a/TSRM/tsrm_win32.c +++ b/TSRM/tsrm_win32.c @@ -612,6 +612,12 @@ TSRM_API int shmget(int key, int size, int flags) created = TRUE; } if (!shm_handle || !info_handle) { + if (shm_handle) { + CloseHandle(shm_handle); + } + if (info_handle) { + CloseHandle(info_handle); + } return -1; } } else { -- cgit v1.2.1