From: Seunghun Lee Date: Wed, 23 Dec 2015 06:56:00 +0000 (+0900) Subject: fix bug reported by static analyzer. X-Git-Tag: submit/tizen/20151223.234019~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f294efb26d96e7f84fa898d16b9c94ea33798e51;p=platform%2Fcore%2Fuifw%2Fe-mod-tizen-wl-textinput.git fix bug reported by static analyzer. Change-Id: Id97f02d95b4888039ff7d323904ccad889d154fe --- diff --git a/src/e_mod_main.c b/src/e_mod_main.c index fb107ec..17a3ca6 100644 --- a/src/e_mod_main.c +++ b/src/e_mod_main.c @@ -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