Commit 32ead2cb46400b60bdf1a8168fcf7110a5c7760b

Ryan C. Gordon 2019-06-12T15:37:07

vulkan: Fixed use-after-free bug.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/src/video/SDL_vulkan_utils.c b/src/video/SDL_vulkan_utils.c
index fb63e0d..b99dfb4 100644
--- a/src/video/SDL_vulkan_utils.c
+++ b/src/video/SDL_vulkan_utils.c
@@ -400,9 +400,7 @@ SDL_bool SDL_Vulkan_Display_CreateSurface(void *vkGetInstanceProcAddr_,
                 vkGetDisplayPlaneSupportedDisplaysKHR(physicalDevice, i, &planeSupportedDisplaysCount, NULL);
             if (result != VK_SUCCESS || planeSupportedDisplaysCount == 0)
             {
-                /* No supported displays, on to next plane. */
-                SDL_free(displayPlaneProperties);
-                continue;
+                continue;  /* No supported displays, on to next plane. */
             }
             SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "vulkandisplay: Number of supported displays for plane %u: %u", i, planeSupportedDisplaysCount);