aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2017-08-27 11:20:27 +0100
committerEmil Velikov <[email protected]>2017-08-29 13:40:49 +0100
commit83442112d7136b6d0c2f6d84c409c04664aeb154 (patch)
tree3b97992b401d5fea73f7c9f711e65247422fb58a /src
parent2f76dff65f83a28b335497ab216a8bb71e6c97a2 (diff)
egl/wayland: plug leaks in dri2_wl_create_window_surface() error path
We forgot to teardown the wl display/surface wrappers. Fixes: 03dd9a88b0b ("egl/wayland: Use per-surface event queues") Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Daniel Stone <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/egl/drivers/dri2/platform_wayland.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
index 0b6cd1d1167..05263fe99da 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -190,7 +190,7 @@ dri2_wl_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
dri2_surf->wl_surface_wrapper = get_wl_surface_proxy(window);
if (!dri2_surf->wl_surface_wrapper) {
_eglError(EGL_BAD_ALLOC, "dri2_create_surface");
- goto cleanup_drm;
+ goto cleanup_dpy_wrapper;
}
wl_proxy_set_queue((struct wl_proxy *)dri2_surf->wl_surface_wrapper,
dri2_surf->wl_queue);
@@ -218,13 +218,17 @@ dri2_wl_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
dri2_surf);
if (dri2_surf->dri_drawable == NULL) {
_eglError(EGL_BAD_ALLOC, "createNewDrawable");
- goto cleanup_surf;
+ goto cleanup_surf_wrapper;
}
dri2_surf->base.SwapInterval = dri2_dpy->default_swap_interval;
return &dri2_surf->base;
+ cleanup_surf_wrapper:
+ wl_proxy_wrapper_destroy(dri2_surf->wl_surface_wrapper);
+ cleanup_dpy_wrapper:
+ wl_proxy_wrapper_destroy(dri2_surf->wl_dpy_wrapper);
cleanup_drm:
if (dri2_surf->wl_drm_wrapper)
wl_proxy_wrapper_destroy(dri2_surf->wl_drm_wrapper);