From: Emil Velikov <[email protected]>

As we fail to open the node, we leak the node/device name.

Cc: [email protected]
Cc: Eric Engestrom <[email protected]>
Signed-off-by: Emil Velikov <[email protected]>
---
 src/egl/drivers/dri2/platform_wayland.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/egl/drivers/dri2/platform_wayland.c 
b/src/egl/drivers/dri2/platform_wayland.c
index b05f5363163..df25a482908 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -1125,6 +1125,8 @@ drm_handle_device(void *data, struct wl_drm *drm, const 
char *device)
 
    dri2_dpy->fd = loader_open_device(dri2_dpy->device_name);
    if (dri2_dpy->fd == -1) {
+      free(dri2_dpy->device_name);
+      dri2_dpy->device_name = NULL:
       _eglLog(_EGL_WARNING, "wayland-egl: could not open %s (%s)",
               dri2_dpy->device_name, strerror(errno));
       return;
-- 
2.19.1

_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to