From bcd63bdfadef684cecc3b0c954a0809ffbceb2e8 Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Wed, 14 Jul 2010 02:22:10 +0000 Subject: [PATCH] Fix goof from automated tools (Coccinelle) and make sure we have a KEY before trying to stringshare it. SVN revision: 50243 --- src/modules/illume/e_kbd_buf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/illume/e_kbd_buf.c b/src/modules/illume/e_kbd_buf.c index 6869cc800..28100b573 100644 --- a/src/modules/illume/e_kbd_buf.c +++ b/src/modules/illume/e_kbd_buf.c @@ -29,7 +29,7 @@ _e_kbd_buf_layout_unref(E_Kbd_Buf_Layout *kbl) while (kbl->keys) { E_Kbd_Buf_Key *ky; - + ky = kbl->keys->data; if (ky->key) eina_stringshare_del(ky->key); if (ky->key_shift) eina_stringshare_del(ky->key_shift); @@ -384,7 +384,7 @@ e_kbd_buf_layout_key_add(E_Kbd_Buf *kb, const char *key, const char *key_shift, if (!kb->layout) return; ky = E_NEW(E_Kbd_Buf_Key, 1); if (!ky) return; - ky->key = eina_stringshare_add(key); + if (key) ky->key = eina_stringshare_add(key); if (key_shift) ky->key_shift = eina_stringshare_add(key_shift); if (key_capslock) ky->key_capslock = eina_stringshare_add(key_capslock); ky->x = x;