summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvain Becker <sylvain.becker@gmail.com>2019-10-30 21:12:36 +0100
committerSylvain Becker <sylvain.becker@gmail.com>2019-10-30 21:12:36 +0100
commit7a18b5b6ca4f75f3e65191e227162e44a6258047 (patch)
treec10d6bf48838a03ec325c4d5f7b804479548b0bf
parent51c9915b0379e7f73fa1a9065f7a89b0cf38480a (diff)
Wayland: touch events, use of memory after it is freed
-rw-r--r--src/video/wayland/SDL_waylandevents.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/video/wayland/SDL_waylandevents.c b/src/video/wayland/SDL_waylandevents.c
index 2f842e1948..013ac660b3 100644
--- a/src/video/wayland/SDL_waylandevents.c
+++ b/src/video/wayland/SDL_waylandevents.c
@@ -151,10 +151,14 @@ touch_del(SDL_TouchID id, float* x, float* y, struct wl_surface **surface)
touch_points.tail = tp->prev;
}
- SDL_free(tp);
+ {
+ struct SDL_WaylandTouchPoint *next = tp->next;
+ SDL_free(tp);
+ tp = next;
+ }
+ } else {
+ tp = tp->next;
}
-
- tp = tp->next;
}
}