{
int ret = DATACONTROL_ERROR_NONE;
map_response_cb_s *map_dc_temp = (map_response_cb_s *)calloc(1, sizeof(map_response_cb_s));
- void *map_dc_returned = NULL;
+ map_response_cb_s *map_dc_returned = NULL;
+ char *tmp_provider_id;
g_hash_table_remove(__socket_pair_hash, provider->provider_id);
goto EXCEPTION;
}
- map_dc_returned = tdelete(map_dc_temp, &datacontrol_map_tree_root, __map_instance_compare);
+ map_dc_returned = (map_response_cb_s *)tfind(map_dc_temp, &datacontrol_map_tree_root, __map_instance_compare);
if (map_dc_returned == NULL) {
LOGE("invalid parameter");
ret = DATACONTROL_ERROR_INVALID_PARAMETER;
goto EXCEPTION;
}
+ if (map_dc_returned->app_id)
+ free(map_dc_returned->app_id);
+ if (map_dc_returned->data_id)
+ free(map_dc_returned->data_id);
+ if (map_dc_returned->access_info)
+ free(map_dc_returned->access_info);
+ if (map_dc_returned->request_info_list)
+ g_list_free_full(map_dc_returned->request_info_list, free);
+
+ tmp_provider_id = map_dc_returned->provider_id;
+ tdelete(map_dc_temp, &datacontrol_map_tree_root, __map_instance_compare);
+ free(tmp_provider_id);
+
/* LCOV_EXCL_START */
EXCEPTION:
if (map_dc_temp) {
__add_callback_result_cb_list = g_list_append(__add_callback_result_cb_list, result_cb_info);
LOGI("datacontrol_add_data_change_cb done");
- return ret;
/* LCOV_EXCL_START */
err:
if (access)
free(provider_app_id);
if (path)
free(path);
- if (monitor_id > 0)
- g_dbus_connection_signal_unsubscribe(_get_dbus_connection(), monitor_id);
+ if (ret != DATACONTROL_ERROR_NONE) {
+ if (monitor_id > 0)
+ g_dbus_connection_signal_unsubscribe(_get_dbus_connection(), monitor_id);
+ }
return ret;
/* LCOV_EXCL_STOP */
int datacontrol_sql_unregister_response_cb(datacontrol_h provider)
{
int ret = DATACONTROL_ERROR_NONE;
- void *sql_dc_returned = NULL;
+ sql_response_cb_s *sql_dc_returned = NULL;
+ char *tmp_provider_id;
LOGE("g_hash_table_remove");
goto EXCEPTION;
}
- sql_dc_returned = tdelete(sql_dc_temp, &datacontrol_sql_tree_root, __sql_instance_compare);
+ sql_dc_returned = (sql_response_cb_s *)tfind(sql_dc_temp, &datacontrol_sql_tree_root, __sql_instance_compare);
if (sql_dc_returned == NULL) {
LOGE("invalid parameter");
ret = DATACONTROL_ERROR_INVALID_PARAMETER;
goto EXCEPTION;
}
+ if (sql_dc_returned->app_id)
+ free(sql_dc_returned->app_id);
+ if (sql_dc_returned->data_id)
+ free(sql_dc_returned->data_id);
+ if (sql_dc_returned->access_info)
+ free(sql_dc_returned->access_info);
+ if (sql_dc_returned->request_info_list)
+ g_list_free_full(sql_dc_returned->request_info_list, free);
+
+ tmp_provider_id = sql_dc_returned->provider_id;
+ tdelete(sql_dc_temp, &datacontrol_sql_tree_root, __sql_instance_compare);
+ free(tmp_provider_id);
+
EXCEPTION:
if (sql_dc_temp) {
if (sql_dc_temp->provider_id)