summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet6/in6_prefix.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/netinet6/in6_prefix.c b/sys/netinet6/in6_prefix.c
index b75a72f..1eaea50 100644
--- a/sys/netinet6/in6_prefix.c
+++ b/sys/netinet6/in6_prefix.c
@@ -603,14 +603,16 @@ add_each_addr(struct socket *so, struct rr_prefix *rpp, struct rp_addr *rap)
if (ia6 != NULL) {
if (ia6->ia6_ifpr == NULL) {
/* link this addr and the prefix each other */
- IFAFREE(&rap->ra_addr->ia_ifa);
+ if (rap->ra_addr)
+ IFAFREE(&rap->ra_addr->ia_ifa);
rap->ra_addr = ia6;
rap->ra_addr->ia_ifa.ifa_refcnt++;
ia6->ia6_ifpr = rp2ifpr(rpp);
return;
}
if (ia6->ia6_ifpr == rp2ifpr(rpp)) {
- IFAFREE(&rap->ra_addr->ia_ifa);
+ if (rap->ra_addr)
+ IFAFREE(&rap->ra_addr->ia_ifa);
rap->ra_addr = ia6;
rap->ra_addr->ia_ifa.ifa_refcnt++;
return;
OpenPOWER on IntegriCloud