summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/net-popup.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/src/net-popup.c b/src/net-popup.c
index 9020dd9..9d64598 100755
--- a/src/net-popup.c
+++ b/src/net-popup.c
@@ -229,35 +229,49 @@ void __net_popup_send_data_usage_msg(const char *app_id,
ret = stc_initialize(&stc);
if (ret != STC_ERROR_NONE) {
- log_print(NET_POPUP, "Failed to get operation ret= %d\n", ret);
- return;
+ log_print(NET_POPUP, "Failed to initialize ret= %d\n", ret);
+ goto DONE;
}
ret = stc_restriction_rule_create(stc, &rule);
if (ret != STC_ERROR_NONE) {
log_print(NET_POPUP, "Failed to create restriction rule ret= %d\n", ret);
- return;
+ goto DONE;
}
ret = stc_restriction_rule_set_app_id(rule, app_id);
if (ret != STC_ERROR_NONE) {
log_print(NET_POPUP, "Failed to set application ID ret= %d\n", ret);
- return;
+ goto DONE;
}
ret = stc_restriction_rule_set_iface_type(rule, iftype[0] - '0');
if (ret != STC_ERROR_NONE) {
log_print(NET_POPUP, "Failed to set interface type ret= %d\n", ret);
- return;
+ goto DONE;
}
ret = stc_unset_restriction(stc, rule);
if (ret != STC_ERROR_NONE) {
log_print(NET_POPUP, "Failed to unset restriction ret= %d\n", ret);
- return;
+ goto DONE;
}
log_print(NET_POPUP, "Success to unset restriction\n");
+
+DONE:
+ if (rule) {
+ ret = stc_restriction_rule_destroy(rule);
+ if (ret != STC_ERROR_NONE)
+ log_print(NET_POPUP, "Failed to destroy restriction rule ret= %d\n", ret);
+ }
+
+ if (stc) {
+ ret = stc_deinitialize(stc);
+ if (ret != STC_ERROR_NONE)
+ log_print(NET_POPUP, "Failed to deinitialize ret= %d\n", ret);
+ }
+
return;
}
@@ -1833,6 +1847,9 @@ error:
if (noti != NULL)
notification_free(noti);
+
+ if (service_handle)
+ app_control_destroy(service_handle);
}
static void __net_popup_del_found_ap_noti(void)