Tip of the day: Never let a sick person code.
[reactos.git] / reactos / lib / kernel32 / file / volume.c
index 905202f..48e1062 100644 (file)
@@ -826,7 +826,7 @@ GetVolumeNameForVolumeMountPointW(
     * an NT acceptable name.
     */
 
-   if (!RtlDosPathNameToNtPathName_U(VolumeName, &NtFileName, NULL, NULL))
+   if (!RtlDosPathNameToNtPathName_U(VolumeMountPoint, &NtFileName, NULL, NULL))
    {
       SetLastError(ERROR_PATH_NOT_FOUND);
       return FALSE;
@@ -946,6 +946,7 @@ GetVolumeNameForVolumeMountPointW(
          else if (!NT_SUCCESS(Status))
          {
             RtlFreeHeap(GetProcessHeap(), 0, MountPoint);
+            NtClose(FileHandle);
             SetLastErrorByStatus(Status);
             return FALSE;
          }