Skip to content

Commit c585068

Browse files
authored
Merge pull request microsoft#1978 from tyrielv/tyrielv/fix-handle-leak-getfinalpathname
Fix handle leak in GetFinalPathName
2 parents c62d9dd + 55bcda1 commit c585068

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

GVFS/GVFS.NativeHooks.Common/common.windows.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ PATH_STRING GetFinalPathName(const PATH_STRING& path)
2828

2929
wchar_t finalPathByHandle[MAX_PATH] = { 0 };
3030
DWORD finalPathSize = GetFinalPathNameByHandleW(fileHandle, finalPathByHandle, MAX_PATH, FILE_NAME_NORMALIZED);
31+
CloseHandle(fileHandle);
3132
if (finalPathSize == 0)
3233
{
3334
die(ReturnCode::PathNameError, "Could not get final path name by handle for %ls, Error: %d\n", path.c_str(), GetLastError());

0 commit comments

Comments
 (0)