From: hyunuktak Date: Wed, 19 Sep 2018 00:56:19 +0000 (+0900) Subject: Fixed svace issues for dereference null return value X-Git-Tag: submit/tizen/20180919.090201^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F71%2F189571%2F1;p=platform%2Fcore%2Fapi%2Fsmart-traffic-control.git Fixed svace issues for dereference null return value Change-Id: I05984b387f22b6b2a9b90fef9d5a11f3b36f8ef4 Signed-off-by: hyunuktak --- diff --git a/src/stc-restriction.c b/src/stc-restriction.c index 3ba77fc..e83cef3 100755 --- a/src/stc-restriction.c +++ b/src/stc-restriction.c @@ -288,15 +288,15 @@ static void __stc_restriction_get_per_app_id_reply( if (iter != NULL) { restriction_rule = g_try_malloc0( sizeof(stc_restriction_rule_s)); + if (restriction_rule) { + _stc_dbus_dictionary_foreach(iter, + __stc_restriction_extract_rule_cb, restriction_rule); - _stc_dbus_dictionary_foreach(iter, - __stc_restriction_extract_rule_cb, restriction_rule); - - __stc_restriction_print_rule(restriction_rule); - - restriction_list = g_slist_append(restriction_list, - (stc_restriction_rule_s *)restriction_rule); + __stc_restriction_print_rule(restriction_rule); + restriction_list = g_slist_append(restriction_list, + (stc_restriction_rule_s *)restriction_rule); + } g_variant_iter_free(iter); } @@ -347,15 +347,15 @@ static void __stc_restriction_get_all_reply( while (g_variant_iter_next(iter, "a{sv}", &iter_row)) { restriction_rule = g_try_malloc0( sizeof(stc_restriction_rule_s)); + if (restriction_rule) { + _stc_dbus_dictionary_foreach(iter_row, + __stc_restriction_extract_rule_cb, restriction_rule); - _stc_dbus_dictionary_foreach(iter_row, - __stc_restriction_extract_rule_cb, restriction_rule); - - __stc_restriction_print_rule(restriction_rule); - - restriction_list = g_slist_append(restriction_list, - (stc_restriction_rule_s *)restriction_rule); + __stc_restriction_print_rule(restriction_rule); + restriction_list = g_slist_append(restriction_list, + (stc_restriction_rule_s *)restriction_rule); + } g_variant_iter_free(iter_row); } g_variant_iter_free(iter);