Fix set_mobile_restriction_rule_parameters 04/198004/1
authorKiseok Chang <kiso.chang@samsung.com>
Thu, 10 Jan 2019 08:02:05 +0000 (17:02 +0900)
committerLukasz Stanislawski <l.stanislaws@samsung.com>
Thu, 17 Jan 2019 11:55:40 +0000 (12:55 +0100)
- Fix the function not to free 'rule'

Change-Id: I44c5776189c8a2d049ddba9ec1cbd13711dcf3ad
Signed-off-by: Kiseok Chang <kiso.chang@samsung.com>
smartmanager-data/src/smartmanager-utils.c

index 133d1bc8c3df22649c8c18868617d1f4a8cdac75..fa8b74bc76a0e4eba2c925a98768b39777a71b4e 100644 (file)
@@ -357,7 +357,6 @@ restrictions_result set_mobile_restriction_rule_parameters(
 
        ret = stc_restriction_rule_set_app_id(rule, "TOTAL_DATACALL");
        if (STC_ERROR_NONE != ret) {
-               stc_restriction_rule_destroy(rule);
                SETTING_TRACE_ERROR("stc_restriction_rule_set_app_id() error: %s",
                                                                                        get_error_message(ret));
                return RESTRICTIONS_ERROR;
@@ -365,7 +364,6 @@ restrictions_result set_mobile_restriction_rule_parameters(
 
        ret = stc_restriction_rule_set_iface_type(rule, STC_IFACE_DATACALL);
        if (STC_ERROR_NONE != ret) {
-               stc_restriction_rule_destroy(rule);
                SETTING_TRACE_ERROR("stc_restriction_rule_set_iface_type() error: %s",
                                                                                        get_error_message(ret));
                return RESTRICTIONS_ERROR;
@@ -373,7 +371,6 @@ restrictions_result set_mobile_restriction_rule_parameters(
 
        ret = stc_restriction_rule_set_subscriber_id(rule, subscriber_id);
        if (STC_ERROR_NONE != ret) {
-               stc_restriction_rule_destroy(rule);
                SETTING_TRACE_ERROR("stc_restriction_rule_set_subscriber_id() error:"\
                                                        "%s", get_error_message(ret));
 
@@ -382,7 +379,6 @@ restrictions_result set_mobile_restriction_rule_parameters(
 
        ret = stc_restriction_rule_set_limit(rule, limit);
        if (STC_ERROR_NONE != ret) {
-               stc_restriction_rule_destroy(rule);
                SETTING_TRACE_ERROR("stc_restriction_rule_set_limit() error: %s",
                                                                                        get_error_message(ret));
                return RESTRICTIONS_ERROR;
@@ -390,7 +386,6 @@ restrictions_result set_mobile_restriction_rule_parameters(
 
        ret = stc_restriction_rule_set_warning_limit(rule, warning_limit);
        if (STC_ERROR_NONE != ret) {
-               stc_restriction_rule_destroy(rule);
                SETTING_TRACE_ERROR(
                        "stc_restriction_rule_set_warning_limit() error: %s",
                        get_error_message(ret));
@@ -419,7 +414,7 @@ restrictions_result set_mobile_limit_restrictions(stc_h stc_handle,
        result = set_mobile_restriction_rule_parameters(rule, subscriber_id, limit,
                                                                                                        warning_limit);
        if (RESTRICTIONS_OK != result) {
-               SETTING_TRACE_ERROR("set_restriction_rule_parameters() error");
+               SETTING_TRACE_ERROR("set_mobile_restriction_rule_parameters() error");
                stc_restriction_rule_destroy(rule);
                return result;
        }