From 37deb2abf62d62ca7f3d53472bf0b6fe6e6221cc Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Mon, 30 Dec 2013 01:36:48 -0600 Subject: [PATCH] win32_set_security_descriptor(): Check handle before closing --- src/win32_apply.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/win32_apply.c b/src/win32_apply.c index 312bd876..6ac9e409 100644 --- a/src/win32_apply.c +++ b/src/win32_apply.c @@ -578,7 +578,7 @@ win32_set_security_descriptor(const wchar_t *path, const u8 *desc, ret = 0; out_close: #ifdef WITH_NTDLL - if (func_NtSetSecurityObject) + if (func_NtSetSecurityObject && h != INVALID_HANDLE_VALUE) CloseHandle(h); #endif return ret; -- 2.43.0