From 1c6e63e880d1d4afef4dc3b009007c11ecc436ad Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jonas=20=C3=85dahl?= Date: Fri, 25 Oct 2013 23:18:04 +0200 Subject: [PATCH] shell: Don't leak weston_touch_move_grab structs MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jonas Ådahl --- src/shell.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/shell.c b/src/shell.c index a5e653e..badfd0c 100644 --- a/src/shell.c +++ b/src/shell.c @@ -1130,12 +1130,14 @@ touch_move_grab_down(struct weston_touch_grab *grab, uint32_t time, static void touch_move_grab_up(struct weston_touch_grab *grab, uint32_t time, int touch_id) { - struct shell_touch_grab *shell_grab = container_of(grab, - struct shell_touch_grab, - grab); + struct weston_touch_move_grab *move = + (struct weston_touch_move_grab *) container_of( + grab, struct shell_touch_grab, grab); - if (grab->touch->seat->num_tp == 0) - shell_touch_grab_end(shell_grab); + if (grab->touch->seat->num_tp == 0) { + shell_touch_grab_end(&move->base); + free(move); + } } static void -- 2.7.4