fix bug reported by static analyzer. 25/55325/1
authorSeunghun Lee <shiin.lee@samsung.com>
Wed, 23 Dec 2015 06:56:00 +0000 (15:56 +0900)
committerSeunghun Lee <shiin.lee@samsung.com>
Wed, 23 Dec 2015 07:04:25 +0000 (16:04 +0900)
Change-Id: Id97f02d95b4888039ff7d323904ccad889d154fe

src/e_mod_main.c

index fb107ec..17a3ca6 100644 (file)
@@ -1155,6 +1155,10 @@ _e_text_cb_bind_input_method(struct wl_client *client, void *data, uint32_t vers
 
    if (!input_method) return;
 
+   resource = wl_resource_create(client, &wl_input_method_interface, 1, id);
+   if (EINA_UNLIKELY(!resource))
+     return;
+
    if (input_method->resource)
      {
         wl_resource_post_error(resource, WL_DISPLAY_ERROR_INVALID_OBJECT,
@@ -1162,15 +1166,10 @@ _e_text_cb_bind_input_method(struct wl_client *client, void *data, uint32_t vers
         return;
      }
 
-   resource = wl_resource_create(client, &wl_input_method_interface, 1, id);
-
    input_method->resource = resource;
 
-   if (resource)
-     {
-        wl_resource_set_implementation(resource, NULL, input_method,
-                                       _e_text_input_method_cb_unbind);
-     }
+   wl_resource_set_implementation(resource, NULL, input_method,
+                                  _e_text_input_method_cb_unbind);
 }
 
 static void