mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2026-03-16 05:34:32 -04:00
wayland-util: return -1 if wl_array_copy() fails
We might have to perform memory allocations in wl_array_copy(), so catch out-of-memory errors in wl_array_add() and return -1 before changing any state. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
parent
66e4aa98cf
commit
0d5850e6d6
2 changed files with 10 additions and 4 deletions
|
|
@ -165,7 +165,7 @@ struct wl_array {
|
|||
void wl_array_init(struct wl_array *array);
|
||||
void wl_array_release(struct wl_array *array);
|
||||
void *wl_array_add(struct wl_array *array, size_t size);
|
||||
void wl_array_copy(struct wl_array *array, struct wl_array *source);
|
||||
int wl_array_copy(struct wl_array *array, struct wl_array *source);
|
||||
|
||||
typedef int32_t wl_fixed_t;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue