From 53f2b7aea256caeb7c456557f4a45dfc7dd32030 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 4 Mar 2021 19:33:47 +0300 Subject: [PATCH] wineopenxr: Don't leak our_images on error in wine_xrEnumerateSwapchainImages(). Signed-off-by: Paul Gofman --- wineopenxr/openxr.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/wineopenxr/openxr.c b/wineopenxr/openxr.c index 18be66b2..45b7045e 100644 --- a/wineopenxr/openxr.c +++ b/wineopenxr/openxr.c @@ -1550,7 +1550,7 @@ XrResult WINAPI wine_xrEnumerateSwapchainImages(XrSwapchain swapchain, uint32_t wine_XrSwapchain *wine_swapchain = (wine_XrSwapchain *)swapchain; wine_XrInstance *wine_instance = wine_swapchain->wine_session->wine_instance; XrResult res; - XrSwapchainImageVulkanKHR *our_images; + XrSwapchainImageVulkanKHR *our_images = NULL; XrSwapchainImageBaseHeader *their_images = images; HRESULT hr; uint32_t i; @@ -1598,10 +1598,9 @@ XrResult WINAPI wine_xrEnumerateSwapchainImages(XrSwapchain swapchain, uint32_t } WINE_TRACE("Successfully allocated texture %p\n", their_d3d11[i].texture); } - - heap_free(our_images); } } + heap_free(our_images); return res; }