Mesa (staging/22.1): vulkan/wsi/x11: Don't leak shm_reply if we don't have dri3 or present

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jul 12 17:20:15 UTC 2022


Module: Mesa
Branch: staging/22.1
Commit: fcb327dd37049c09fde161020c1591895478f24c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=fcb327dd37049c09fde161020c1591895478f24c

Author: Jason Ekstrand <jason.ekstrand at collabora.com>
Date:   Wed Jul  6 19:30:11 2022 -0500

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 <jenatali at microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17388>
(cherry picked from commit 5abc05f1df44dd9ee2f054729b2bdf01a5e45e33)

---

 .pick_status.json               | 2 +-
 src/vulkan/wsi/wsi_common_x11.c | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 9a391b04213..bcfbabe2d6e 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1984,7 +1984,7 @@
         "description": "vulkan/wsi/x11: Don't leak shm_reply if we don't have dri3 or present",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "b5c390c113d3f23af49f8bf5a601474620ae4eb1"
     },
diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c
index 7422cee1431..3188498a990 100644
--- a/src/vulkan/wsi/wsi_common_x11.c
+++ b/src/vulkan/wsi/wsi_common_x11.c
@@ -302,7 +302,6 @@ wsi_x11_connection_create(struct wsi_device *wsi_dev,
             free(error);
          }
       }
-      free(shm_reply);
    }
 
    free(dri3_reply);
@@ -310,6 +309,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;
 }



More information about the mesa-commit mailing list