[WGID:199951,199961] Fix svace 85/159585/1 accepted/tizen_3.0_common accepted/tizen_3.0_mobile accepted/tizen_3.0_wearable tizen_3.0 accepted/tizen/3.0/common/20171113.121003 accepted/tizen/3.0/mobile/20171111.021021 accepted/tizen/3.0/wearable/20171111.021025 submit/tizen_3.0/20171110.023258
authorJeesun Kim <iamjs.kim@samsung.com>
Fri, 10 Nov 2017 02:09:43 +0000 (11:09 +0900)
committerJeesun Kim <iamjs.kim@samsung.com>
Fri, 10 Nov 2017 02:10:08 +0000 (11:10 +0900)
Change-Id: I521208eaa61693f743f1194c1b8897823c4ccdeb

utils/MsgUtilFunction.cpp

index 392e088..b7f0bf2 100755 (executable)
@@ -1286,14 +1286,6 @@ void* _msg_launch_app(void *data)
 
 msg_error_t msg_launch_app(const char *app_id, bundle *bundle_data)
 {
-       msg_launch_app_data *data = (msg_launch_app_data *)calloc(1, sizeof(msg_launch_app_data));
-       if (data == NULL) {
-               MSG_ERR("Memory alloc failed!");
-               return MSG_ERR_MEMORY_ERROR;
-       }
-
-       data->app_id = g_strdup(app_id);
-       data->bundle_data = bundle_dup(bundle_data);
        pthread_t thd;
        pthread_attr_t attr;
 
@@ -1307,6 +1299,15 @@ msg_error_t msg_launch_app(const char *app_id, bundle *bundle_data)
                return MSG_ERR_UNKNOWN;
        }
 
+       msg_launch_app_data *data = (msg_launch_app_data *)calloc(1, sizeof(msg_launch_app_data));
+       if (data == NULL) {
+               MSG_ERR("Memory alloc failed!");
+               return MSG_ERR_MEMORY_ERROR;
+       }
+
+       data->app_id = g_strdup(app_id);
+       data->bundle_data = bundle_dup(bundle_data);
+
        if (pthread_create(&thd, &attr, &_msg_launch_app, data) < 0) {
                MSG_ERR("pthread_create() error");
        }