aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/touch.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/touch.c b/examples/touch.c
index a32c76ba..7e01a6c2 100644
--- a/examples/touch.c
+++ b/examples/touch.c
@@ -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) {