From cb806a5d56b228a8eddde34b063b42dde79dd8a7 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Tue, 2 Jul 2019 01:26:54 +0200 Subject: [PATCH] [dxvk] Free memory if vkMapMemory fails Otherwise, we leak the allocated memory chunk and make the problem even worse than it already is. --- src/dxvk/dxvk_memory.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dxvk/dxvk_memory.cpp b/src/dxvk/dxvk_memory.cpp index f9a76c25..3a095c56 100644 --- a/src/dxvk/dxvk_memory.cpp +++ b/src/dxvk/dxvk_memory.cpp @@ -340,6 +340,7 @@ namespace dxvk { if (status != VK_SUCCESS) { Logger::err(str::format("DxvkMemoryAllocator: Mapping memory failed with ", status)); + m_vkd->vkFreeMemory(m_vkd->device(), result.memHandle, nullptr); return DxvkDeviceMemory(); } }