]> wimlib.net Git - wimlib/commitdiff
win32_set_security_descriptor(): Check handle before closing
authorEric Biggers <ebiggers3@gmail.com>
Mon, 30 Dec 2013 07:36:48 +0000 (01:36 -0600)
committerEric Biggers <ebiggers3@gmail.com>
Mon, 30 Dec 2013 07:36:48 +0000 (01:36 -0600)
src/win32_apply.c

index 312bd87605647b9b4ab5c3caf0ca48bedd1bb55d..6ac9e4090ec53bac1bf7585327652e1f433ab39f 100644 (file)
@@ -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;