mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-29 05:40:12 -04:00
Prevent alloc errors from crashing in list_t
This commit changes the `list_t` api so that alloc errors can be
detected and worked around. Also fixes errors not found in 5cc7342
This commit is contained in:
parent
19d6442f52
commit
901c14c409
8 changed files with 103 additions and 25 deletions
|
|
@ -65,7 +65,9 @@ static void handle_touch_down(struct touch_state *tstate, int32_t slot,
|
|||
point->slot = slot;
|
||||
point->x = x / width;
|
||||
point->y = y / height;
|
||||
list_add(sample->touch_points, point);
|
||||
if (list_add(sample->touch_points, point) == -1) {
|
||||
free(point);
|
||||
}
|
||||
}
|
||||
|
||||
static void handle_touch_up(struct touch_state *tstate, int32_t slot) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue