Fix build warning 13/200913/4 accepted/tizen/unified/20190315.061255 submit/tizen/20190314.071214
authorYu <jiung.yu@samsung.com>
Wed, 6 Mar 2019 00:39:38 +0000 (09:39 +0900)
committerYu <jiung.yu@samsung.com>
Thu, 7 Mar 2019 04:01:41 +0000 (13:01 +0900)
Change-Id: I4ed4c13505a97d2221467a6cb78b8022dd269ac3
Signed-off-by: Yu Jiung <jiung.yu@samsung.com>
src/inm-rtnl.c

index cf1ca2e84806fd8cb1a0250fc47292a5189db429..503752ca229ee0f585d5526a212758f1ef831ed7 100644 (file)
@@ -485,7 +485,10 @@ static inline void __addr_fill_info(struct rtnl_addr *p_rtnl_addr, inm_rtnl_addr
        p_addr->scope = rtnl_addr_get_scope(p_rtnl_addr);
 
        nl_addr2str(p_nl_addr, buf, sizeof(buf));
-       CHECK_STRING_AND_COPY(buf, p_addr->address);
+       g_free(p_addr->address);
+       p_addr->address = NULL;
+       if (strlen(buf) != 0)
+               p_addr->address = g_strdup(buf);
        p_addr->family = nl_addr_get_family(p_nl_addr);
        p_addr->prefix_length = nl_addr_get_prefixlen(p_nl_addr);
 }
@@ -637,7 +640,7 @@ static inline void __neigh_copy(inm_rtnl_neigh_s *src, inm_rtnl_neigh_s *dst)
                return;
 
        dst->if_idx = src->if_idx;
-       dst->state =    src->state;
+       dst->state = src->state;
 
        CHECK_STRING_AND_COPY(src->ll, dst->ll);
        CHECK_STRING_AND_COPY(src->dest, dst->dest);