---
 src/stkutil.c |   60 +++++++++++++++++++++++++-------------------------------
 1 files changed, 27 insertions(+), 33 deletions(-)

diff --git a/src/stkutil.c b/src/stkutil.c
index 3adb9e3..1a0c678 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -2116,11 +2116,11 @@ static gboolean parse_display_text(struct stk_command 
*command,
                                &obj->frame_id,
                                STK_DATA_OBJECT_TYPE_INVALID);
 
+       command->destructor = destroy_display_text;
+
        if (ret == FALSE)
                return FALSE;
 
-       command->destructor = destroy_display_text;
-
        return TRUE;
 }
 
@@ -2154,11 +2154,11 @@ static gboolean parse_get_inkey(struct stk_command 
*command,
                                &obj->frame_id,
                                STK_DATA_OBJECT_TYPE_INVALID);
 
+       command->destructor = destroy_get_inkey;
+
        if (ret == FALSE)
                return FALSE;
 
-       command->destructor = destroy_get_inkey;
-
        return TRUE;
 }
 
@@ -2196,11 +2196,11 @@ static gboolean parse_get_input(struct stk_command 
*command,
                                &obj->frame_id,
                                STK_DATA_OBJECT_TYPE_INVALID);
 
+       command->destructor = destroy_get_input;
+
        if (ret == FALSE)
                return FALSE;
 
-       command->destructor = destroy_get_input;
-
        return TRUE;
 }
 
@@ -2247,11 +2247,11 @@ static gboolean parse_play_tone(struct stk_command 
*command,
                                &obj->frame_id,
                                STK_DATA_OBJECT_TYPE_INVALID);
 
+       command->destructor = destroy_play_tone;
+
        if (ret == FALSE)
                return FALSE;
 
-       command->destructor = destroy_play_tone;
-
        return TRUE;
 }
 
@@ -2275,8 +2275,6 @@ static gboolean parse_poll_interval(struct stk_command 
*command,
        if (ret == FALSE)
                return FALSE;
 
-       command->destructor = NULL;
-
        return TRUE;
 }
 
@@ -2330,10 +2328,12 @@ static gboolean parse_setup_menu(struct stk_command 
*command,
        gboolean ret;
 
        if (command->src != STK_DEVICE_IDENTITY_TYPE_UICC)
-               goto error;
+               return FALSE;
 
        if (command->dst != STK_DEVICE_IDENTITY_TYPE_TERMINAL)
-               goto error;
+               return FALSE;
+
+       command->destructor = destroy_setup_menu;
 
        ret = parse_dataobj(iter,
                        STK_DATA_OBJECT_TYPE_ALPHA_ID,
@@ -2342,12 +2342,12 @@ static gboolean parse_setup_menu(struct stk_command 
*command,
                        STK_DATA_OBJECT_TYPE_INVALID);
 
        if (ret == FALSE)
-               goto error;
+               return FALSE;
 
        obj->items = parse_item_list(iter);
 
        if (obj->items == NULL)
-               goto error;
+               return FALSE;
 
        ret = parse_dataobj(iter,
                        STK_DATA_OBJECT_TYPE_ITEMS_NEXT_ACTION_INDICATOR, 0,
@@ -2363,15 +2363,9 @@ static gboolean parse_setup_menu(struct stk_command 
*command,
                        STK_DATA_OBJECT_TYPE_INVALID);
 
        if (ret == FALSE)
-               goto error;
-
-       command->destructor = destroy_setup_menu;
+               return FALSE;
 
        return TRUE;
-
-error:
-       destroy_setup_menu(command);
-       return FALSE;
 }
 
 static void destroy_select_item(struct stk_command *command)
@@ -2566,11 +2560,11 @@ static gboolean parse_setup_call(struct stk_command 
*command,
                                &obj->frame_id,
                                STK_DATA_OBJECT_TYPE_INVALID);
 
+       command->destructor = destroy_setup_call;
+
        if (ret == FALSE)
                return FALSE;
 
-       command->destructor = destroy_setup_call;
-
        return TRUE;
 }
 
@@ -2607,11 +2601,11 @@ static gboolean parse_refresh(struct stk_command 
*command,
                                &obj->frame_id,
                                STK_DATA_OBJECT_TYPE_INVALID);
 
+       command->destructor = destroy_refresh;
+
        if (ret == FALSE)
                return FALSE;
 
-       command->destructor = destroy_refresh;
-
        return TRUE;
 }
 
@@ -2790,11 +2784,11 @@ static gboolean parse_setup_idle_mode_text(struct 
stk_command *command,
                                &obj->frame_id,
                                STK_DATA_OBJECT_TYPE_INVALID);
 
+       command->destructor = destroy_setup_idle_mode_text;
+
        if (ret == FALSE)
                return FALSE;
 
-       command->destructor = destroy_setup_idle_mode_text;
-
        return TRUE;
 }
 
@@ -2829,11 +2823,11 @@ static gboolean parse_run_at_command(struct stk_command 
*command,
                                &obj->frame_id,
                                STK_DATA_OBJECT_TYPE_INVALID);
 
+       command->destructor = destroy_run_at_command;
+
        if (ret == FALSE)
                return FALSE;
 
-       command->destructor = destroy_run_at_command;
-
        return TRUE;
 }
 
@@ -2868,11 +2862,11 @@ static gboolean parse_send_dtmf(struct stk_command 
*command,
                                &obj->frame_id,
                                STK_DATA_OBJECT_TYPE_INVALID);
 
+       command->destructor = destroy_send_dtmf;
+
        if (ret == FALSE)
                return FALSE;
 
-       command->destructor = destroy_send_dtmf;
-
        return TRUE;
 }
 
@@ -2987,11 +2981,11 @@ static gboolean parse_launch_browser(struct stk_command 
*command,
                        &obj->text_passwd,
                        STK_DATA_OBJECT_TYPE_INVALID);
 
+       command->destructor = destroy_launch_browser;
+
        if (ret == FALSE)
                return FALSE;
 
-       command->destructor = destroy_launch_browser;
-
        return TRUE;
 
 error:
-- 
1.7.0.4

_______________________________________________
ofono mailing list
[email protected]
http://lists.ofono.org/listinfo/ofono

Reply via email to