Fixed some coverity for resource leak 36/174536/3
authorhyunuktak <hyunuk.tak@samsung.com>
Tue, 3 Apr 2018 00:48:20 +0000 (09:48 +0900)
committerhyunuktak <hyunuk.tak@samsung.com>
Tue, 3 Apr 2018 04:36:44 +0000 (13:36 +0900)
Change-Id: I18d828bd6b10af992adc48333a962787831df7b0
Signed-off-by: hyunuktak <hyunuk.tak@samsung.com>
packaging/capi-network-wifi-manager.spec
src/network_interface.c
test/wifi_manager_test.c
tool/wifi_mgr_public.c

index 77f6f76ac10a84956e612e5a2541d1e66195802b..fee193263aced0ea94556e33789cf8a51fa38734 100755 (executable)
@@ -1,6 +1,6 @@
 Name:          capi-network-wifi-manager
 Summary:       Network Wi-Fi library in TIZEN C API
-Version:       1.0.33
+Version:       1.0.34
 Release:       1
 Group:         System/Network
 License:       Apache-2.0
index c6c1d2d2b8ef6274131a648af04325ad6b8b0427..40703afd4e34ce54a8e136fb749d9a0b86a5b093 100755 (executable)
@@ -498,9 +498,9 @@ static int __net_extract_common_info(const char *key, GVariant *variant, net_pro
                                else if (g_strcmp0(dns_type, "ipv6.dhcp") == 0)
                                        net_info->DnsConfigType6 =
                                                NET_DNS_CONFIG_TYPE_DYNAMIC;
+                               g_free(dns_type);
                        }
                }
-               g_free(dns_type);
                g_variant_iter_free(iter);
 
                net_info->DnsCount = dnsCount;
@@ -545,9 +545,9 @@ static int __net_extract_common_info(const char *key, GVariant *variant, net_pro
                                else if (g_strcmp0(dns_type, "ipv6.dhcp") == 0)
                                        net_info->DnsConfigType6 =
                                                NET_DNS_CONFIG_TYPE_DYNAMIC;
+                               g_free(dns_type);
                        }
                }
-               g_free(dns_type);
                g_variant_iter_free(iter);
 
                net_info->DnsCount = dnsCount;
index c48a82bd1322e49b51bfb0cf01e3f5f8e4e81392..16a2037c45748258328f3a2fc95a003374803b0b 100755 (executable)
@@ -532,6 +532,7 @@ static bool __test_found_eap_ap_callback(wifi_manager_ap_h ap, void *user_data)
                if (rv != WIFI_MANAGER_ERROR_NONE) {
                        printf("Fail to set eap type : %s\n", __test_convert_error_to_string(rv));
                        g_free(ap_name);
+                       g_free(inputed_name);
                        return false;
                }
 
@@ -544,6 +545,7 @@ static bool __test_found_eap_ap_callback(wifi_manager_ap_h ap, void *user_data)
                                printf("Fail to set eap certificatefile : %s\n",
                                                __test_convert_error_to_string(rv));
                                g_free(ap_name);
+                               g_free(inputed_name);
                                return false;
                        }
                }
@@ -562,6 +564,7 @@ static bool __test_found_eap_ap_callback(wifi_manager_ap_h ap, void *user_data)
                        printf("Fail to set eap auth type : %s\n",
                                        __test_convert_error_to_string(rv));
                        g_free(ap_name);
+                       g_free(inputed_name);
                        return false;
                }
 
@@ -714,6 +717,7 @@ static bool __test_found_change_ip_method_callback(wifi_manager_ap_h ap, void *u
 
                if (rv == false || (address_type != 0 && address_type != 1)) {
                        printf("Invalid input!!\n");
+                       g_free(ap_name);
                        return false;
                }
 
@@ -920,6 +924,7 @@ static bool __test_found_change_proxy_method_callback(wifi_manager_ap_h ap, void
 
                if (rv == false || (address_type != 0 && address_type != 1)) {
                        printf("Invalid input!!\n");
+                       g_free(ap_name);
                        return false;
                }
 
@@ -1118,6 +1123,7 @@ static bool __test_found_print_ap_info_callback(wifi_manager_ap_h ap, void *user
 
                if (rv == false || (address_type != 0 && address_type != 1)) {
                        printf("Invalid input!!\n");
+                       g_free(ap_name);
                        return false;
                }
 
index abee5eec99a92623fe6bc994956dd13d6f064e15..76c4f80400994656543a544ca7f1f0f06357ead1 100755 (executable)
@@ -254,6 +254,7 @@ static int _test_public_get_connected_ap(MManager *mm, struct menu_data *menu)
 
        msg(HR_SINGLE);
 
+       FREE(essid);
        return ret;
 }