From b82cb14698d208f173e4b99a432d6be59ee68627 Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Fri, 3 May 2013 06:38:24 +0100 Subject: [PATCH] e_xkb_layout_get can return NULL so trap for that and only set the names.layout below if needed. Signed-off-by: Chris Michael --- src/bin/e_comp_wl.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index dc3eb50..ac6a329 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -839,10 +839,11 @@ _e_comp_wl_input_keymap_get(void) memset(&names, 0, sizeof(names)); - kbd_layout = e_xkb_layout_get(); - - names.model = strdup(kbd_layout->model); - names.layout = strdup(kbd_layout->name); + if ((kbd_layout = e_xkb_layout_get())) + { + names.model = strdup(kbd_layout->model); + names.layout = strdup(kbd_layout->name); + } /* if we are running under X11, try to get the xkb rule names atom */ if (getenv("DISPLAY")) @@ -870,10 +871,11 @@ _e_comp_wl_input_keymap_get(void) { names.rules = strdup((const char *)data); data += strlen((const char *)data) + 1; - /* names.model = strdup((const char *)data); */ - /* data += strlen((const char *)data) + 1; */ - /* names.layout = strdup((const char *)data); */ -// free(data); + if (!names.model) + names.model = strdup((const char *)data); + data += strlen((const char *)data) + 1; + if (!names.layout) + names.layout = strdup((const char *)data); } } -- 2.7.4