summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2012-10-30 18:10:30 -0400
committerKristian Høgsberg <krh@bitplanet.net>2012-10-30 18:10:32 -0400
commite77d7577a25b5eb5c6bc79a9ce0ea335a4df6508 (patch)
treeb287e089fdf0373c8b2c73d0bd734643b23b35c9
parentefb948846fa598f9d14e6bfbba9591a3bb8819ef (diff)
downloadweston-e77d7577a25b5eb5c6bc79a9ce0ea335a4df6508.tar.gz
window: Fix use-after-free in menu button handler
Commit d2fbb3870cfaea623a87ba28c9587676bbdc93f7 introduced a use-after-free error in the case where we destroy the menu.
-rw-r--r--clients/window.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/clients/window.c b/clients/window.c
index d5a14dd0..fe968ed5 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -3363,10 +3363,9 @@ menu_button_handler(struct widget *widget,
menu->current, menu->window->parent->user_data);
input_ungrab(input);
menu_destroy(menu);
- }
-
- if (state == WL_POINTER_BUTTON_STATE_RELEASED)
+ } else if (state == WL_POINTER_BUTTON_STATE_RELEASED) {
menu->release_count++;
+ }
}
static void