Fixed incorrect comparision and memory leaks
[platform/core/connectivity/net-config.git] / src / network-state.c
index 3e616c4..33bc1c7 100755 (executable)
@@ -1078,10 +1078,8 @@ void netconfig_update_default_profile(const char *profile)
                netconfig_default_connection_info.freq = 0;
                netconfig_default_connection_info.is_metered = FALSE;
 
-               if (wifi_state_get_service_state() != NETCONFIG_WIFI_CONNECTED) {
-                       g_free(netconfig_default_connection_info.essid);
-                       netconfig_default_connection_info.essid = NULL;
-               }
+               g_free(netconfig_default_connection_info.essid);
+               netconfig_default_connection_info.essid = NULL;
        }
 
        /* default profile is NULL and new connected profile is NULL */