[Mesa-stable] [PATCH 2/2] egl/wayland: plug memory leak in drm_handle_device()
Emil Velikov
emil.l.velikov at gmail.com
Tue Nov 27 11:39:42 UTC 2018
From: Emil Velikov <emil.velikov at collabora.com>
As we fail to open the node, we leak the node/device name.
Cc: mesa-stable at lists.freedesktop.org
Cc: Eric Engestrom <eric.engestrom at intel.com>
Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
---
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
More information about the mesa-stable
mailing list