Fixed some coverity for resource leak 39/197539/2 accepted/tizen/4.0/unified/20190114.234156 submit/tizen_4.0/20190114.044225
authorSeonah Moon <seonah1.moon@samsung.com>
Mon, 14 Jan 2019 04:21:22 +0000 (13:21 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Mon, 14 Jan 2019 04:21:25 +0000 (13:21 +0900)
Change-Id: Ieec80adf4ccd73628b7620bfe1fd3b817f9b008f

src/network_interface.c
test/wifi_manager_test.c
tool/wifi_mgr_public.c

index c29ff8dda54b20a83599e75da31a0dc5f39d2878..bf67c552aa40946de86e85951ac07d8346df7d3a 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 3418f5a87ab3f901b27fe813f3a744eec0be9612..ca0654b681e66780815b5828f0294a14390ac340 100755 (executable)
@@ -529,6 +529,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;
                }
 
@@ -541,6 +542,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;
                        }
 
@@ -558,6 +560,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;
                        }
                }
@@ -711,6 +714,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;
                }
 
@@ -917,6 +921,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;
                }
 
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;
 }