Fix svace issue (WGID-212341) 45/128045/1 accepted/tizen/unified/20170504.114205 submit/tizen/20170504.080025
authorchleun.moon <chleun.moon@samsung.com>
Thu, 4 May 2017 07:55:11 +0000 (16:55 +0900)
committerchleun.moon <chleun.moon@samsung.com>
Thu, 4 May 2017 07:55:16 +0000 (16:55 +0900)
Change-Id: Id693e2c4ec8be78684ec0b414be2dc4c66953979
Signed-off-by: cheoleun <chleun.moon@samsung.com>
src/signal-handler.c

index 0221bc2..385bd98 100755 (executable)
@@ -112,10 +112,10 @@ static void __netconfig_extract_ipv4_signal_data(GVariant *dictionary, const gch
 
                        DBG("Old IPv4.Address [%s] Received new IPv4.Address [%s]", old_ip, value);
                        if (g_strcmp0(old_ip, value) != 0) {
-                               if (value == NULL && strlen(old_ip) > 0)
-                                       vconf_set_str(VCONFKEY_NETWORK_IP, "");
-                               else
+                               if (value != NULL)
                                        vconf_set_str(VCONFKEY_NETWORK_IP, value);
+                               else if (old_ip != NULL && strlen(old_ip) > 0)
+                                       vconf_set_str(VCONFKEY_NETWORK_IP, "");
                        }
                        free(old_ip);
                }
@@ -137,10 +137,10 @@ static void __netconfig_extract_ipv6_signal_data(GVariant *dictionary, const gch
 
                        DBG("Old IPv6.Address [%s] Received new IPv6.Address [%s]", old_ip6, value);
                        if (g_strcmp0(old_ip6, value) != 0) {
-                               if (value == NULL && strlen(old_ip6) > 0)
-                                       vconf_set_str(VCONFKEY_NETWORK_IP6, "");
-                               else
+                               if (value != NULL)
                                        vconf_set_str(VCONFKEY_NETWORK_IP6, value);
+                               else if (old_ip6 != NULL && strlen(old_ip6) > 0)
+                                       vconf_set_str(VCONFKEY_NETWORK_IP6, "");
                        }
                        free(old_ip6);
                }