return ret;
}
- ret = __request_appsvc_run(caller_app_id, app_id);
- if (ret != DATA_CONTROL_ERROR_NONE) {
- bundle_free(send_data);
- return ret;
- }
-
socket_hash_key = strdup(provider->provider_id);
if (socket_hash_key == NULL) {
+ bundle_free(send_data);
+ _socket_info_free((gpointer)socket_info);
_LOGE("Out of memory");
return DATA_CONTROL_ERROR_OUT_OF_MEMORY;
}
+ ret = __request_appsvc_run(caller_app_id, app_id);
+ if (ret != DATA_CONTROL_ERROR_NONE) {
+ bundle_free(send_data);
+ _socket_info_free((gpointer)socket_info);
+ free(socket_hash_key);
+ return ret;
+ }
+
g_hash_table_insert(__socket_pair_hash,
socket_hash_key, socket_info);
}
bundle_add_str(arg_list, AUL_K_DATA_CONTROL_TYPE, "CORE");
pid = appsvc_run_service(arg_list, 0, NULL, NULL);
+ bundle_free(arg_list);
+
if (pid >= 0) {
_LOGI("Launch the provider app successfully: %d", pid);
- bundle_free(arg_list);
} else if (pid == APPSVC_RET_EINVAL) {
_LOGE("not able to launch service: %d", pid);
- bundle_free(arg_list);
return DATA_CONTROL_ERROR_INVALID_PARAMETER;
} else {
_LOGE("unable to launch service: %d", pid);
goto err;
}
- cb_info = (changed_cb_info_s *)calloc(1,
- sizeof(changed_cb_info_s));
- if (cb_info == NULL) {
- _LOGE("changed_cb_info_s alloc fail out of memory.");
- ret = DATA_CONTROL_ERROR_OUT_OF_MEMORY;
- goto err;
- }
-
- cb_info->changed_cb = callback;
- cb_info->user_data = user_data;
- cb_info->callback_id = data_changed_callback_id;
-
result_cb_info =
(add_callback_result_cb_info_s *)calloc(1, sizeof(add_callback_result_cb_info_s));
if (result_cb_info == NULL) {
goto err;
}
+ cb_info = (changed_cb_info_s *)calloc(1, sizeof(changed_cb_info_s));
+ if (cb_info == NULL) {
+ _LOGE("changed_cb_info_s alloc fail out of memory.");
+ ret = DATA_CONTROL_ERROR_OUT_OF_MEMORY;
+ goto err;
+ }
+
+ cb_info->changed_cb = callback;
+ cb_info->user_data = user_data;
+ cb_info->callback_id = data_changed_callback_id;
+
provider_info->cb_list = g_list_append(
provider_info->cb_list, cb_info);
+
*callback_id = data_changed_callback_id;
result_cb_info->timeout_id =