From: Frank Binns Date: Thu, 4 Aug 2016 14:15:40 +0000 (+0100) Subject: wayland-drm: add missing NULL check X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2f3154f464ba0942da3e3509ff4e42928e7b60f7;p=mesa.git wayland-drm: add missing NULL check Although malloc is unlikely to fail check its return value nevertheless. Signed-off-by: Frank Binns Reviewed-by: Eric Engestrom Reviewed-by: Emil Velikov --- diff --git a/src/egl/wayland/wayland-drm/wayland-drm.c b/src/egl/wayland/wayland-drm/wayland-drm.c index e00d9be6a91..4fc12521d24 100644 --- a/src/egl/wayland/wayland-drm/wayland-drm.c +++ b/src/egl/wayland/wayland-drm/wayland-drm.c @@ -265,6 +265,8 @@ wayland_drm_init(struct wl_display *display, char *device_name, struct wl_drm *drm; drm = malloc(sizeof *drm); + if (!drm) + return NULL; drm->display = display; drm->device_name = strdup(device_name);