wayland-client: Handle potential NULL-deref

Instead, return -1 on out-of-memory.  errno will be set to ENOMEM by
the failing malloc.
This commit is contained in:
Kristian Høgsberg 2013-07-13 00:42:14 -04:00
parent 8bd93c5c9d
commit e0579bfb61

View file

@ -662,6 +662,8 @@ wl_display_roundtrip(struct wl_display *display)
done = 0;
callback = wl_display_sync(display);
if (callback == NULL)
return -1;
wl_callback_add_listener(callback, &sync_listener, &done);
while (!done && ret >= 0)
ret = wl_display_dispatch(display);