Fix issue detected by static analysis tool 19/170419/2
authorJihoon Kim <jihoon48.kim@samsung.com>
Tue, 20 Feb 2018 02:25:17 +0000 (11:25 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Tue, 20 Feb 2018 02:25:43 +0000 (11:25 +0900)
Branch past initialization : If the variable is used after the target, it will be uninitialized.

Change-Id: I6d6d32650616b9803829c8954caa5ee5b31ae3cc
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
src/e_mod_main.c

index 7a4a3ab..1e73523 100644 (file)
@@ -1229,6 +1229,7 @@ _e_text_input_cb_activate(struct wl_client *client, struct wl_resource *resource
    E_Input_Method *input_method = NULL;
    E_Text_Input *old = NULL;
    E_Input_Method_Context *context = NULL;
+   E_Client *ec = NULL;
 
    EINA_SAFETY_ON_NULL_GOTO(resource, err);
    EINA_SAFETY_ON_NULL_GOTO(seat, err);
@@ -1236,7 +1237,7 @@ _e_text_input_cb_activate(struct wl_client *client, struct wl_resource *resource
    EINA_SAFETY_ON_NULL_GOTO(g_input_method->resource, err);
 
    /* Store application window's E_Client* value for setting transient_for information later */
-   E_Client *ec = wl_resource_get_user_data(surface);
+   ec = wl_resource_get_user_data(surface);
    EINA_SAFETY_ON_NULL_GOTO(ec, err);
    EINA_SAFETY_ON_TRUE_GOTO(e_object_is_del(E_OBJECT(ec)), err);
    client_surface_ec = ec;