forked from enlightenment/enlightenment
wayland: Check for potential OOM from wl_array_add()
Summary: wl_array_add() returns NULL if it can't malloc/realloc. This is probably unlikely but check for it and issue a meaningful error if it occurs. Reviewers: cedric, devilhorns, zmike, raster Reviewed By: raster Subscribers: raster, cedric Differential Revision: https://phab.enlightenment.org/D2054
This commit is contained in:
parent
b7f3a81f59
commit
13f4582c76
|
@ -815,7 +815,11 @@ _e_comp_wl_cb_key_down(void *event)
|
|||
}
|
||||
|
||||
cdata->kbd.keys.size = (const char *)end - (const char *)cdata->kbd.keys.data;
|
||||
k = wl_array_add(&cdata->kbd.keys, sizeof(*k));
|
||||
if (!(k = wl_array_add(&cdata->kbd.keys, sizeof(*k))))
|
||||
{
|
||||
DBG("wl_array_add: Out of memory\n");
|
||||
return;
|
||||
}
|
||||
*k = keycode;
|
||||
|
||||
if ((ec = e_client_focused_get()))
|
||||
|
|
Loading…
Reference in New Issue