From cb25354dcececae2878eb30d54d187c23429a002 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 25 Feb 2019 21:48:56 +0100 Subject: [PATCH] Better place for CloseHandle --- Common/FileUtil.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/FileUtil.cpp b/Common/FileUtil.cpp index a869389dd9..5ca7b0f1b9 100644 --- a/Common/FileUtil.cpp +++ b/Common/FileUtil.cpp @@ -133,8 +133,8 @@ std::string ResolvePath(const std::string &path) { int result = getFinalPathNameByHandleW(hFile, buf, BUF_SIZE - 1, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); if (result >= BUF_SIZE || result == 0) wcscpy_s(buf, BUF_SIZE - 1, input.c_str()); + CloseHandle(hFile); } - CloseHandle(hFile); } else { wchar_t *longBuf = new wchar_t[BUF_SIZE]; memset(buf, 0, BUF_SIZE);