Mesa (master): vulkan: don't free uninitialised memory

Eric Engeström eric_engestrom at kemper.freedesktop.org
Tue May 29 17:04:07 UTC 2018


Module: Mesa
Branch: master
Commit: e4fe2fd3bb26d52e64d98207692a4469f04fe1d5
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e4fe2fd3bb26d52e64d98207692a4469f04fe1d5

Author: Eric Engestrom <eric.engestrom at intel.com>
Date:   Fri May 18 17:12:53 2018 +0100

vulkan: don't free uninitialised memory

The modifiers array hasn't been initialised by then, much less with data
that would need freeing.
Move the label after the loop to fix this.

Fixes: c80c08e22603 ("vulkan/wsi/x11: Add support for DRI3 v1.2")
Signed-off-by: Eric Engestrom <eric.engestrom at intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>

---

 src/vulkan/wsi/wsi_common_x11.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c
index 62739b9912..1bfbc7c300 100644
--- a/src/vulkan/wsi/wsi_common_x11.c
+++ b/src/vulkan/wsi/wsi_common_x11.c
@@ -1421,10 +1421,10 @@ fail_init_images:
    for (uint32_t j = 0; j < image; j++)
       x11_image_finish(chain, pAllocator, &chain->images[j]);
 
-fail_register:
    for (int i = 0; i < ARRAY_SIZE(modifiers); i++)
       vk_free(pAllocator, modifiers[i]);
 
+fail_register:
    xcb_unregister_for_special_event(chain->conn, chain->special_event);
 
    wsi_swapchain_finish(&chain->base);




More information about the mesa-commit mailing list