diff options
-rw-r--r-- | usr.sbin/rtadvd/config.c | 10 | ||||
-rw-r--r-- | usr.sbin/rtadvd/dump.c | 14 | ||||
-rw-r--r-- | usr.sbin/rtadvd/if.c | 5 |
3 files changed, 11 insertions, 18 deletions
diff --git a/usr.sbin/rtadvd/config.c b/usr.sbin/rtadvd/config.c index ee3996ad1f8..e340d9ca97c 100644 --- a/usr.sbin/rtadvd/config.c +++ b/usr.sbin/rtadvd/config.c @@ -1,4 +1,4 @@ -/* $OpenBSD: config.c,v 1.44 2015/10/25 22:11:34 jca Exp $ */ +/* $OpenBSD: config.c,v 1.45 2015/12/11 20:15:52 mmcc Exp $ */ /* $KAME: config.c,v 1.62 2002/05/29 10:13:10 itojun Exp $ */ /* @@ -807,11 +807,9 @@ make_packet(struct rainfo *rainfo) /* allocate memory for the packet */ if ((buf = malloc(packlen)) == NULL) fatal("malloc"); - if (rainfo->ra_data) { - /* free the previous packet */ - free(rainfo->ra_data); - rainfo->ra_data = NULL; - } + /* free the previous packet */ + free(rainfo->ra_data); + rainfo->ra_data = NULL; rainfo->ra_data = buf; /* XXX: what if packlen > 576? */ rainfo->ra_datalen = packlen; diff --git a/usr.sbin/rtadvd/dump.c b/usr.sbin/rtadvd/dump.c index 16d860e3b7f..34b26403782 100644 --- a/usr.sbin/rtadvd/dump.c +++ b/usr.sbin/rtadvd/dump.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dump.c,v 1.16 2015/10/25 22:11:34 jca Exp $ */ +/* $OpenBSD: dump.c,v 1.17 2015/12/11 20:15:52 mmcc Exp $ */ /* $KAME: dump.c,v 1.27 2002/05/29 14:23:55 itojun Exp $ */ /* @@ -204,14 +204,10 @@ rtadvd_dump(void) vltime, (vltimexpire)? vltimexpire : "", pltime, (pltimexpire)? pltimexpire : "", flags); - if (vltimexpire) { - free(vltimexpire); - vltimexpire = NULL; - } - if (pltimexpire) { - free(pltimexpire); - pltimexpire = NULL; - } + free(vltimexpire); + vltimexpire = NULL; + free(pltimexpire); + pltimexpire = NULL; free(vltime); free(pltime); free(flags); diff --git a/usr.sbin/rtadvd/if.c b/usr.sbin/rtadvd/if.c index a1a2e221c10..0b68beebffe 100644 --- a/usr.sbin/rtadvd/if.c +++ b/usr.sbin/rtadvd/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.34 2015/12/01 12:11:31 jca Exp $ */ +/* $OpenBSD: if.c,v 1.35 2015/12/11 20:15:52 mmcc Exp $ */ /* $KAME: if.c,v 1.17 2001/01/21 15:27:30 itojun Exp $ */ /* @@ -503,8 +503,7 @@ init_iflist(void) free(ifblock); ifblock_size = 0; } - if (iflist) - free(iflist); + free(iflist); /* get iflist block from kernel */ get_iflist(&ifblock, &ifblock_size); |