mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2024-11-25 00:22:25 +00:00
render/egl: Release devices before return
This commit is contained in:
parent
5df2b34d2b
commit
3048fb3fc6
@ -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)) {
|
if (!egl->procs.eglQueryDevicesEXT(nb_devices, devices, &nb_devices)) {
|
||||||
wlr_log(WLR_ERROR, "Failed to query EGL devices");
|
wlr_log(WLR_ERROR, "Failed to query EGL devices");
|
||||||
|
free(devices);
|
||||||
return EGL_NO_DEVICE_EXT;
|
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);
|
int ret = drmGetDevice(drm_fd, &device);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
wlr_log(WLR_ERROR, "Failed to get DRM device: %s", strerror(-ret));
|
wlr_log(WLR_ERROR, "Failed to get DRM device: %s", strerror(-ret));
|
||||||
|
free(devices);
|
||||||
return EGL_NO_DEVICE_EXT;
|
return EGL_NO_DEVICE_EXT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user