devilhorns pushed a commit to branch master.

commit b82cb14698d208f173e4b99a432d6be59ee68627
Author: Chris Michael <[email protected]>
Date:   Fri May 3 06:38:24 2013 +0100

    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 <[email protected]>
---
 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);
           }
      }
 

-- 

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2

Reply via email to