From 19e75367b07ebfa5576bfb2c4154e90c0735a8d4 Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Mon, 11 Jun 2012 17:11:38 +0000 Subject: [PATCH] Ecore_Wayland: Patch from Rob Bradford to add missing NULL checks for ecore_wl_input. SVN revision: 71957 --- legacy/ecore/ChangeLog | 4 ++++ legacy/ecore/src/lib/ecore_wayland/ecore_wl_input.c | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/legacy/ecore/ChangeLog b/legacy/ecore/ChangeLog index 82d26ba736..120da0940b 100644 --- a/legacy/ecore/ChangeLog +++ b/legacy/ecore/ChangeLog @@ -735,3 +735,7 @@ * Ecore_Wayland: Update to protocol change - axis events are now fixed point numbers +2012-06-11 Rob Bradford + + * Ecore_Wayland: Add missing null pointer checks on input device + deletion (ticket #1031). Not all devices are keyboards. diff --git a/legacy/ecore/src/lib/ecore_wayland/ecore_wl_input.c b/legacy/ecore/src/lib/ecore_wayland/ecore_wl_input.c index 54ca296271..19e39b2bff 100644 --- a/legacy/ecore/src/lib/ecore_wayland/ecore_wl_input.c +++ b/legacy/ecore/src/lib/ecore_wayland/ecore_wl_input.c @@ -238,8 +238,10 @@ _ecore_wl_input_del(Ecore_Wl_Input *input) if (input->seat) wl_seat_destroy(input->seat); wl_list_remove(&input->link); - xkb_state_unref(input->xkb.state); - xkb_map_unref(input->xkb.keymap); + if (input->xkb.state) + xkb_state_unref(input->xkb.state); + if (input->xkb.keymap) + xkb_map_unref(input->xkb.keymap); free(input); }