diff options
author | hyunuktak <hyunuk.tak@samsung.com> | 2019-01-08 16:57:05 +0900 |
---|---|---|
committer | hyunuktak <hyunuk.tak@samsung.com> | 2019-01-08 16:57:24 +0900 |
commit | d50ec8cff3abc3a7f8150930e4d7814c514dee6b (patch) | |
tree | 9dad3164663fa0717acac9e714ed2aa983fe3613 | |
parent | 26480d804c1807a1357fa8a687d018d2ab30ca2a (diff) | |
download | net-popup-accepted/tizen_4.0_unified.tar.gz net-popup-accepted/tizen_4.0_unified.tar.bz2 net-popup-accepted/tizen_4.0_unified.zip |
Fixed memory leaksubmit/tizen_4.0/20190108.091146accepted/tizen/4.0/unified/20190108.223811tizen_4.0accepted/tizen_4.0_unified
WGID : 331526
Change-Id: Ia506a175ca767d23425411aeedcdf2e23e1f89aa
Signed-off-by: hyunuktak <hyunuk.tak@samsung.com>
-rwxr-xr-x | packaging/net.netpopup.spec | 2 | ||||
-rwxr-xr-x | src/net-popup.c | 26 |
2 files changed, 21 insertions, 7 deletions
diff --git a/packaging/net.netpopup.spec b/packaging/net.netpopup.spec index d4e5c47..d3fff07 100755 --- a/packaging/net.netpopup.spec +++ b/packaging/net.netpopup.spec @@ -1,6 +1,6 @@ Name: net.netpopup Summary: Network Notification Popup applicationa -Version: 0.2.88 +Version: 0.2.89 Release: 1 Group: App/Network License: Flora-1.1 diff --git a/src/net-popup.c b/src/net-popup.c index c56b853..20f286b 100755 --- a/src/net-popup.c +++ b/src/net-popup.c @@ -224,35 +224,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; } |