Fix memory leak in `vkcube`.
authorJason Chen <shchenchang@gmail.com>
Thu, 4 Apr 2019 04:45:29 +0000 (12:45 +0800)
committerjeremyk-lunarg <jeremyk@lunarg.com>
Thu, 2 May 2019 16:25:10 +0000 (10:25 -0600)
cube/cube.c

index e4d59fa..ff4d5a6 100644 (file)
@@ -1381,6 +1381,10 @@ static void demo_prepare_buffers(struct demo *demo) {
         demo->next_present_id = 1;
     }
 
+    if (NULL != swapchainImages) {
+        free(swapchainImages);
+    }
+
     if (NULL != presentModes) {
         free(presentModes);
     }
@@ -3473,6 +3477,7 @@ static void demo_init_vk_swapchain(struct demo *demo) {
         demo->format = surfFormats[0].format;
     }
     demo->color_space = surfFormats[0].colorSpace;
+    free(surfFormats);
 
     demo->quit = false;
     demo->curFrame = 0;