wayland-util: return 0 on OOM in wl_map_insert_new()
authorDavid Herrmann <dh.herrmann@googlemail.com>
Thu, 11 Oct 2012 21:37:44 +0000 (23:37 +0200)
committerKristian Høgsberg <krh@bitplanet.net>
Mon, 15 Oct 2012 20:08:27 +0000 (16:08 -0400)
commitc13a65fd202d6e7d22e5ea0e334b50135a1d66a8
tree8b787cc9584f7c1343e64f833d58425aa44f1fdf
parent0d5850e6d67a09a670625dfb99ec9efefdafb75f
wayland-util: return 0 on OOM in wl_map_insert_new()

If we cannot increase the array for new entries, we now return 0 instead
of accessing invalid memory.

krh: Edited to return 0 on failure instead.  In the initialization path,
we call wl_map_insert_new() to insert NULL at index 0, which also returns
0 but not as an error.  Since we do that up front, every other case of
returning 0 is an unambiguous error.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
src/wayland-util.c