mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-03 20:10:17 +01:00
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>
This commit is contained in:
parent
d5f65b8bf5
commit
2f3154f464
1 changed files with 2 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue