devilhorns pushed a commit to branch master.

commit 449c0c72b0f6a98540e52208779d1edc68842e16
Author: Chris Michael <[email protected]>
Date:   Wed Jul 24 07:23:58 2013 +0100

    Check for valid returns of ecore_wl_registry_get and
    ecore_wl_globals_get before trying to use them.
    After we have bound a text input manager, there is no need to keep
    looping the globals, so break out.
    
    Signed-off-by: Chris Michael <[email protected]>
---
 src/modules/ecore_imf/wayland/wayland_module.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/modules/ecore_imf/wayland/wayland_module.c 
b/src/modules/ecore_imf/wayland/wayland_module.c
index 3689f3a..e0d0c00 100644
--- a/src/modules/ecore_imf/wayland/wayland_module.c
+++ b/src/modules/ecore_imf/wayland/wayland_module.c
@@ -95,8 +95,14 @@ im_module_create()
    if (!text_input_manager)
      {
         Ecore_Wl_Global *global;
-        struct wl_registry *registry = ecore_wl_registry_get();
-        struct wl_list *globals = ecore_wl_globals_get();
+        struct wl_registry *registry;
+        struct wl_list *globals;
+
+        if (!(registry = ecore_wl_registry_get()))
+          return NULL;
+
+        if (!(globals = ecore_wl_globals_get()))
+          return NULL;
 
         wl_list_for_each(global, globals, link)
           {
@@ -107,6 +113,7 @@ im_module_create()
                                      &wl_text_input_manager_interface, 1);
                   EINA_LOG_DOM_INFO(_ecore_imf_wayland_log_dom, 
                                     "bound wl_text_input_manager interface");
+                  break;
                }
           }
      }

-- 

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk

Reply via email to