diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2013-07-13 00:42:14 -0400 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2013-07-13 00:42:14 -0400 |
commit | e0579bfb61320653e3af74f5abb3bd50785c10b1 (patch) | |
tree | db3b50cf7d2f96d031810527c7a7d3a82d3068a8 | |
parent | 8bd93c5c9df2c40d01b7918c666edd68c0be1544 (diff) |
wayland-client: Handle potential NULL-deref
Instead, return -1 on out-of-memory. errno will be set to ENOMEM by
the failing malloc.
-rw-r--r-- | src/wayland-client.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/wayland-client.c b/src/wayland-client.c index 34c8196..2887a40 100644 --- a/src/wayland-client.c +++ b/src/wayland-client.c @@ -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); |