[WGID-144187/144188] Fixed memory leak 22/93022/1 accepted/tizen/3.0/ivi/20161028.123010 accepted/tizen/3.0/mobile/20161028.122330 accepted/tizen/3.0/tv/20161028.122559 accepted/tizen/3.0/wearable/20161028.122817 accepted/tizen/common/20161020.173335 accepted/tizen/ivi/20161020.125540 accepted/tizen/ivi/20161024.085855 accepted/tizen/mobile/20161020.125435 accepted/tizen/mobile/20161024.085730 accepted/tizen/tv/20161020.125455 accepted/tizen/tv/20161024.085800 accepted/tizen/wearable/20161020.125519 accepted/tizen/wearable/20161024.085827 submit/tizen/20161020.051143 submit/tizen/20161024.084619 submit/tizen_3.0/20161028.062323 submit/tizen_3.0/20161028.082323 submit/tizen_3.0_common/20161104.104000
authorSeonah Moon <seonah1.moon@samsung.com>
Thu, 20 Oct 2016 05:08:58 +0000 (14:08 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Thu, 20 Oct 2016 05:09:08 +0000 (14:09 +0900)
Change-Id: I262adf24db8ef91e2ec79bbd890eef7dceea4156
Signed-off-by: Seonah Moon <seonah1.moon@samsung.com>
packaging/wifi-efl-ug.spec
sources/libraries/Common/common_ip_info.c

index 2b91175..c8bbe2f 100644 (file)
@@ -1,7 +1,7 @@
 %define _unpackaged_files_terminate_build 0
 Name:          wifi-efl-ug
 Summary:       Wi-Fi UI Gadget for TIZEN
-Version:       1.0.205
+Version:       1.0.206
 Release:       1
 Group:         App/Network
 License:       Flora-1.1
index 2fc7573..de79ba6 100755 (executable)
@@ -1447,7 +1447,7 @@ void ip_info_save_data(full_ip_info_t *ip_data)
        }
 
        if (WIFI_IP_CONFIG_TYPE_STATIC == ip_info_list_data->ip_type) {
-               txt = get_ip_info_text(ENTRY_TYPE_IP_ADDR);
+               txt = g_strdup(get_ip_info_text(ENTRY_TYPE_IP_ADDR));
                if (!txt)
                        txt = g_strdup(DEFAULT_GUIDE_IP);
                if (g_strcmp0(prev_ip_info->ip_addr, txt) != 0) {
@@ -1458,8 +1458,9 @@ void ip_info_save_data(full_ip_info_t *ip_data)
                                ip_data->is_info_changed = TRUE;
                }
                free_ip_info_text(ENTRY_TYPE_IP_ADDR);
+               g_free(txt);
 
-               txt = get_ip_info_text(ENTRY_TYPE_SUBNET_MASK);
+               txt = g_strdup(get_ip_info_text(ENTRY_TYPE_SUBNET_MASK));
                if (!txt)
                        txt = g_strdup(DEFAULT_GUIDE_IP);
                if (g_strcmp0(prev_ip_info->subnet_mask, txt) != 0) {
@@ -1470,8 +1471,9 @@ void ip_info_save_data(full_ip_info_t *ip_data)
                                ip_data->is_info_changed = TRUE;
                }
                free_ip_info_text(ENTRY_TYPE_SUBNET_MASK);
+               g_free(txt);
 
-               txt = get_ip_info_text(ENTRY_TYPE_GATEWAY);
+               txt = g_strdup(get_ip_info_text(ENTRY_TYPE_GATEWAY));
                if (!txt)
                        txt = g_strdup(DEFAULT_GUIDE_IP);
                if (g_strcmp0(prev_ip_info->gateway_addr, txt) != 0) {
@@ -1482,8 +1484,9 @@ void ip_info_save_data(full_ip_info_t *ip_data)
                                ip_data->is_info_changed = TRUE;
                }
                free_ip_info_text(ENTRY_TYPE_GATEWAY);
+               g_free(txt);
 
-               txt = get_ip_info_text(ENTRY_TYPE_DNS_1);
+               txt = g_strdup(get_ip_info_text(ENTRY_TYPE_DNS_1));
                if (!txt)
                        txt = g_strdup(DEFAULT_GUIDE_IP);
                if (g_strcmp0(prev_ip_info->dns_1, txt) != 0) {
@@ -1494,8 +1497,9 @@ void ip_info_save_data(full_ip_info_t *ip_data)
                                ip_data->is_info_changed = TRUE;
                }
                free_ip_info_text(ENTRY_TYPE_DNS_1);
+               g_free(txt);
 
-               txt = get_ip_info_text(ENTRY_TYPE_DNS_2);
+               txt = g_strdup(get_ip_info_text(ENTRY_TYPE_DNS_2));
                if (!txt)
                        txt = g_strdup(DEFAULT_GUIDE_IP);
                if (g_strcmp0(prev_ip_info->dns_2, txt) != 0) {
@@ -1506,16 +1510,17 @@ void ip_info_save_data(full_ip_info_t *ip_data)
                                ip_data->is_info_changed = TRUE;
                }
                free_ip_info_text(ENTRY_TYPE_DNS_2);
+               g_free(txt);
        }
 
-       proxy_addr = get_ip_info_text(ENTRY_TYPE_PROXY_ADDR);
+       proxy_addr =g_strdup(get_ip_info_text(ENTRY_TYPE_PROXY_ADDR));
        if (proxy_addr == NULL) {
                DEBUG_LOG(UG_NAME_NORMAL, "Set proxy type - auto");
                if (prev_ip_info->proxy_type != WIFI_PROXY_TYPE_AUTO) {
                        wifi_ap_set_proxy_type(ap, WIFI_PROXY_TYPE_AUTO);
                }
        } else {
-               proxy_port = txt = get_ip_info_text(ENTRY_TYPE_PROXY_PORT);
+               proxy_port = g_strdup(get_ip_info_text(ENTRY_TYPE_PROXY_PORT));
                if (proxy_port) {
                        txt = g_strdup_printf("%s:%s", proxy_addr, proxy_port);
                } else {
@@ -1532,7 +1537,14 @@ void ip_info_save_data(full_ip_info_t *ip_data)
 
                free_ip_info_text(ENTRY_TYPE_PROXY_ADDR);
                free_ip_info_text(ENTRY_TYPE_PROXY_PORT);
+               g_free(proxy_port);
+               proxy_port = NULL;
+               g_free(txt);
        }
+       txt = NULL;
+
+       g_free(proxy_addr);
+       proxy_addr = NULL;
 
        /* ip_info_print_values(ap); */