[WGID-200168, 200169, 200171] Fixed SVACE issues
[platform/core/connectivity/net-config.git] / src / network-state.c
index 64d6321..15e0cc9 100755 (executable)
@@ -518,7 +518,7 @@ static void __netconfig_update_default_connection_info(void)
                if (g_strcmp0(old_ip, ip_addr) != 0 || old_ip == NULL) {
                        if (ip_addr != NULL)
                                netconfig_set_vconf_str(VCONFKEY_NETWORK_IP, ip_addr);
-                       else if (strlen(old_ip) > 0)
+                       else if (old_ip != NULL && strlen(old_ip) > 0)
                                netconfig_set_vconf_str(VCONFKEY_NETWORK_IP, "");
                }
                g_free(old_ip);
@@ -526,7 +526,7 @@ static void __netconfig_update_default_connection_info(void)
                if (g_strcmp0(old_ip6, ip_addr6) != 0 || old_ip6 == NULL) {
                        if (ip_addr6 != NULL)
                                netconfig_set_vconf_str(VCONFKEY_NETWORK_IP6, ip_addr6);
-                       else if (strlen(old_ip6) > 0)
+                       else if (old_ip6 != NULL && strlen(old_ip6) > 0)
                                netconfig_set_vconf_str(VCONFKEY_NETWORK_IP6, "");
                }
                g_free(old_ip6);