From 5abc05f1df44dd9ee2f054729b2bdf01a5e45e33 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Wed, 6 Jul 2022 19:30:11 -0500 Subject: [PATCH] vulkan/wsi/x11: Don't leak shm_reply if we don't have dri3 or present Fixes: b5c390c113d3 ("vulkan/wsi: add support for detecting mit-shm pixmaps.") Reviewed-by: Jesse Natalie Part-of: --- src/vulkan/wsi/wsi_common_x11.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c index eaabaceafb7..c7ffa5039ad 100644 --- a/src/vulkan/wsi/wsi_common_x11.c +++ b/src/vulkan/wsi/wsi_common_x11.c @@ -322,7 +322,6 @@ wsi_x11_connection_create(struct wsi_device *wsi_dev, free(error); } } - free(shm_reply); } free(dri3_reply); @@ -330,6 +329,8 @@ wsi_x11_connection_create(struct wsi_device *wsi_dev, free(randr_reply); free(amd_reply); free(nv_reply); + if (wsi_dev->sw) + free(shm_reply); return wsi_conn; }