}
}
+static void __stc_free_restriction_rule_members(table_restrictions_info *rule)
+{
+ FREE(rule->app_id);
+ FREE(rule->ifname);
+ FREE(rule->subscriber_id);
+ FREE(rule->mac);
+}
+
gboolean handle_restriction_set(StcRestriction *object,
GDBusMethodInvocation *invocation,
GVariant *parameters,
if (__validate_rstn_rule(&rule) == FALSE) {
STC_RESTRICTION_DBUS_REPLY_ERROR(invocation, //LCOV_EXCL_LINE
STC_ERROR_INVALID_PARAMETER);
+ __stc_free_restriction_rule_members(&rule);
__STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
return TRUE;
}
if (ret != STC_ERROR_NONE) {
STC_RESTRICTION_DBUS_REPLY_ERROR(invocation, //LCOV_EXCL_LINE
STC_ERROR_DB_FAILED);
+ __stc_free_restriction_rule_members(&rule);
__STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
return TRUE;
}
- stc_plugin_monitor_add_rstn(&rule);
+ ret = stc_plugin_monitor_add_rstn(&rule);
+ if (ret == STC_ERROR_UNINITIALIZED) {
+ STC_RESTRICTION_DBUS_REPLY_ERROR(invocation, //LCOV_EXCL_LINE
+ STC_ERROR_UNINITIALIZED);
+ table_restrictions_delete(rule.app_id, rule.iftype, rule.ifname,
+ rule.subscriber_id, rule.roaming);
+ __stc_free_restriction_rule_members(&rule);
+ __STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return TRUE;
+ } else if (ret == STC_ERROR_NO_DATA || ret == STC_ERROR_OUT_OF_MEMORY) {
+ STC_RESTRICTION_DBUS_REPLY_ERROR(invocation, //LCOV_EXCL_LINE
+ ret);
+ __stc_free_restriction_rule_members(&rule);
+ __STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return TRUE;
+ }
STC_DBUS_REPLY_ERROR_NONE(invocation);
+ __stc_free_restriction_rule_members(&rule);
__STC_LOG_FUNC_EXIT__;
return TRUE;
}
if (__validate_rstn_rule(&rule) == FALSE) {
STC_RESTRICTION_DBUS_REPLY_ERROR(invocation, //LCOV_EXCL_LINE
STC_ERROR_INVALID_PARAMETER);
+ __stc_free_restriction_rule_members(&rule);
__STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
return TRUE;
}
if (ret != STC_ERROR_NONE) {
STC_RESTRICTION_DBUS_REPLY_ERROR(invocation, //LCOV_EXCL_LINE
STC_ERROR_DB_FAILED);
+ __stc_free_restriction_rule_members(&rule);
+ __STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return TRUE;
+ }
+
+ ret = stc_plugin_monitor_remove_rstn(&rule);
+ if (ret == STC_ERROR_UNINITIALIZED) {
+ STC_RESTRICTION_DBUS_REPLY_ERROR(invocation, //LCOV_EXCL_LINE
+ STC_ERROR_UNINITIALIZED);
+ __stc_free_restriction_rule_members(&rule);
+ __STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return TRUE;
+ } else if (ret == STC_ERROR_NO_DATA) {
+ table_restrictions_update(&rule);
+ STC_RESTRICTION_DBUS_REPLY_ERROR(invocation, //LCOV_EXCL_LINE
+ STC_ERROR_NO_DATA);
+ __stc_free_restriction_rule_members(&rule);
__STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
return TRUE;
}
- stc_plugin_monitor_remove_rstn(&rule);
STC_DBUS_REPLY_ERROR_NONE(invocation);
+ __stc_free_restriction_rule_members(&rule);
__STC_LOG_FUNC_EXIT__;
return TRUE;
}
STC_RESTRICTION_DBUS_REPLY_ERROR(invocation, ret); //LCOV_EXCL_LINE
g_variant_iter_free(iter_row);
g_variant_iter_free(iter);
+ __stc_free_restriction_rule_members(&rule);
__STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
return TRUE;
}
STC_RESTRICTION_DBUS_REPLY_ERROR(invocation, ret); //LCOV_EXCL_LINE
g_variant_iter_free(iter_row);
g_variant_iter_free(iter);
+ __stc_free_restriction_rule_members(&rule);
__STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
return TRUE;
}
}
+ __stc_free_restriction_rule_members(&rule);
g_variant_iter_free(iter_row);
}
g_variant_iter_free(iter);
STC_RESTRICTION_DBUS_REPLY_ERROR(invocation, ret); //LCOV_EXCL_LINE
g_variant_iter_free(iter_row);
g_variant_iter_free(iter);
+ __stc_free_restriction_rule_members(&rule);
__STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
return TRUE;
}
STC_RESTRICTION_DBUS_REPLY_ERROR(invocation, ret); //LCOV_EXCL_LINE
g_variant_iter_free(iter_row);
g_variant_iter_free(iter);
+ __stc_free_restriction_rule_members(&rule);
__STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
return TRUE;
}
}
+ __stc_free_restriction_rule_members(&rule);
g_variant_iter_free(iter_row);
}
g_variant_iter_free(iter);