Module: Mesa
Branch: master
Commit: ce74a7bb8de7f5b921d53384582de3324290cd60
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ce74a7bb8de7f5b921d53384582de3324290cd60

Author: Emil Velikov <[email protected]>
Date:   Tue Nov 27 11:36:01 2018 +0000

egl/wayland: plug memory leak in drm_handle_device()

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

v2: Log and then free() (Eric)

Cc: [email protected]
Signed-off-by: Emil Velikov <[email protected]>
Reviewed-by: Eric Engestrom <[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 b05f536316..3254ed9120 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -1127,6 +1127,8 @@ drm_handle_device(void *data, struct wl_drm *drm, const 
char *device)
    if (dri2_dpy->fd == -1) {
       _eglLog(_EGL_WARNING, "wayland-egl: could not open %s (%s)",
               dri2_dpy->device_name, strerror(errno));
+      free(dri2_dpy->device_name);
+      dri2_dpy->device_name = NULL:
       return;
    }
 

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

Reply via email to