Fix memory leak 18/143418/2
authorchleun.moon <chleun.moon@samsung.com>
Thu, 10 Aug 2017 01:02:01 +0000 (10:02 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Thu, 10 Aug 2017 07:03:44 +0000 (16:03 +0900)
Change-Id: Id54f9e1d5d0aafe63b7aa437690889f288442462
Signed-off-by: cheoleun <chleun.moon@samsung.com>
packaging/libnet-client.spec
src/network-profile-intf.c

index 82b2766..eec5f55 100755 (executable)
@@ -1,6 +1,6 @@
 Name:          libnet-client
 Summary:       Network Client library (Shared library)
-Version:       1.1.63
+Version:       1.1.64
 Release:       1
 Group:         System/Network
 License:       Flora-1.1
index 4ff87b4..98ddd92 100755 (executable)
@@ -202,7 +202,7 @@ static int __net_telephony_get_profile_info(net_profile_name_t* ProfileName, net
        }
 
        g_variant_get(result, "(a{ss})", &iter);
-       while (g_variant_iter_next(iter, "{ss}", &key, &value)) {
+       while (g_variant_iter_loop(iter, "{ss}", &key, &value)) {
                if (g_strcmp0(key, "path") == 0) {
                        if (value != NULL)
                                g_strlcpy(ProfileInfo->ProfileName, value, NET_PROFILE_NAME_LEN_MAX);
@@ -1086,9 +1086,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;
@@ -1136,9 +1136,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;