From 3048fb3fc62ab771550654f4191f92f87b9065b2 Mon Sep 17 00:00:00 2001 From: YaoBing Xiao Date: Mon, 19 Aug 2024 23:07:35 +0800 Subject: [PATCH] render/egl: Release devices before return --- render/egl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/render/egl.c b/render/egl.c index ce0c95d9..d38f394e 100644 --- a/render/egl.c +++ b/render/egl.c @@ -476,6 +476,7 @@ static EGLDeviceEXT get_egl_device_from_drm_fd(struct wlr_egl *egl, if (!egl->procs.eglQueryDevicesEXT(nb_devices, devices, &nb_devices)) { wlr_log(WLR_ERROR, "Failed to query EGL devices"); + free(devices); return EGL_NO_DEVICE_EXT; } @@ -483,6 +484,7 @@ static EGLDeviceEXT get_egl_device_from_drm_fd(struct wlr_egl *egl, int ret = drmGetDevice(drm_fd, &device); if (ret < 0) { wlr_log(WLR_ERROR, "Failed to get DRM device: %s", strerror(-ret)); + free(devices); return EGL_NO_DEVICE_EXT; }