diff options
author | Frank Binns <frank.binns@imgtec.com> | 2016-08-04 15:15:40 +0100 |
---|---|---|
committer | Emil Velikov <emil.l.velikov@gmail.com> | 2016-09-01 15:48:52 +0100 |
commit | 2f3154f464ba0942da3e3509ff4e42928e7b60f7 (patch) | |
tree | be2b71b1eb5350afe766f963b42606e5ee2a3507 /src/egl/wayland | |
parent | d5f65b8bf54574e45d73938702fb5505449c1b5d (diff) | |
download | external_mesa3d-2f3154f464ba0942da3e3509ff4e42928e7b60f7.zip external_mesa3d-2f3154f464ba0942da3e3509ff4e42928e7b60f7.tar.gz external_mesa3d-2f3154f464ba0942da3e3509ff4e42928e7b60f7.tar.bz2 |
wayland-drm: add missing NULL check
Although malloc is unlikely to fail check its return value nevertheless.
Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Diffstat (limited to 'src/egl/wayland')
-rw-r--r-- | src/egl/wayland/wayland-drm/wayland-drm.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/egl/wayland/wayland-drm/wayland-drm.c b/src/egl/wayland/wayland-drm/wayland-drm.c index e00d9be..4fc1252 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); |