summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/netinet/ip_output.c11
-rw-r--r--sys/netinet/raw_ip.c5
-rw-r--r--sys/netinet/tcp_input.c11
-rw-r--r--sys/netinet/tcp_subr.c5
-rw-r--r--sys/netinet/tcp_usrreq.c5
-rw-r--r--sys/netinet6/ip6_output.c5
-rw-r--r--sys/netinet6/raw_ip6.c5
7 files changed, 18 insertions, 29 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index 10b4adaf67c..c1cf4f68cfe 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_output.c,v 1.333 2016/12/19 09:22:24 rzalamena Exp $ */
+/* $OpenBSD: ip_output.c,v 1.334 2017/01/10 09:01:18 mpi Exp $ */
/* $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $ */
/*
@@ -1074,8 +1074,7 @@ ip_ctloutput(int op, struct socket *so, int level, int optname,
error = ENOPROTOOPT;
break;
}
- if (m)
- (void)m_free(m);
+ m_free(m);
break;
case PRCO_GETOPT:
@@ -1242,15 +1241,13 @@ ip_pcbopts(struct mbuf **pcbopt, struct mbuf *m)
u_char opt;
/* turn off any old options */
- if (*pcbopt)
- (void)m_free(*pcbopt);
+ m_free(*pcbopt);
*pcbopt = 0;
if (m == NULL || m->m_len == 0) {
/*
* Only turning off any previous options.
*/
- if (m)
- (void)m_free(m);
+ m_free(m);
return (0);
}
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c
index af87fe9b18d..0282e35682d 100644
--- a/sys/netinet/raw_ip.c
+++ b/sys/netinet/raw_ip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: raw_ip.c,v 1.90 2016/12/19 09:22:24 rzalamena Exp $ */
+/* $OpenBSD: raw_ip.c,v 1.91 2017/01/10 09:01:18 mpi Exp $ */
/* $NetBSD: raw_ip.c,v 1.25 1996/02/18 18:58:33 christos Exp $ */
/*
@@ -325,8 +325,7 @@ rip_ctloutput(int op, struct socket *so, int level, int optname,
inp->inp_flags |= INP_HDRINCL;
else
inp->inp_flags &= ~INP_HDRINCL;
- if (*mp)
- (void)m_free(*mp);
+ m_free(*mp);
} else {
*mp = m_get(M_WAIT, M_SOOPTS);
(*mp)->m_len = sizeof(int);
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index feef7b084a6..610a7ca165f 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_input.c,v 1.334 2016/12/19 08:36:49 mpi Exp $ */
+/* $OpenBSD: tcp_input.c,v 1.335 2017/01/10 09:01:18 mpi Exp $ */
/* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */
/*
@@ -3340,8 +3340,7 @@ syn_cache_rm(struct syn_cache *sc)
void
syn_cache_put(struct syn_cache *sc)
{
- if (sc->sc_ipopts)
- (void) m_free(sc->sc_ipopts);
+ m_free(sc->sc_ipopts);
if (sc->sc_route4.ro_rt != NULL) {
rtfree(sc->sc_route4.ro_rt);
sc->sc_route4.ro_rt = NULL;
@@ -4035,8 +4034,7 @@ syn_cache_add(struct sockaddr *src, struct sockaddr *dst, struct tcphdr *th,
* If we were remembering a previous source route,
* forget it and use the new one we've been given.
*/
- if (sc->sc_ipopts)
- (void) m_free(sc->sc_ipopts);
+ m_free(sc->sc_ipopts);
sc->sc_ipopts = ipopts;
}
sc->sc_timestamp = tb.ts_recent;
@@ -4049,8 +4047,7 @@ syn_cache_add(struct sockaddr *src, struct sockaddr *dst, struct tcphdr *th,
sc = pool_get(&syn_cache_pool, PR_NOWAIT|PR_ZERO);
if (sc == NULL) {
- if (ipopts)
- (void) m_free(ipopts);
+ m_free(ipopts);
return (-1);
}
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index f80d28dc1a1..5729c1bae48 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_subr.c,v 1.157 2016/12/20 09:57:10 mpi Exp $ */
+/* $OpenBSD: tcp_subr.c,v 1.158 2017/01/10 09:01:18 mpi Exp $ */
/* $NetBSD: tcp_subr.c,v 1.22 1996/02/13 23:44:00 christos Exp $ */
/*
@@ -534,8 +534,7 @@ tcp_close(struct tcpcb *tp)
p = q;
}
#endif
- if (tp->t_template)
- (void) m_free(tp->t_template);
+ m_free(tp->t_template);
tp->t_flags |= TF_DEAD;
timeout_add(&tp->t_reap_to, 0);
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index 39705864219..fca2b4ad67f 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_usrreq.c,v 1.141 2017/01/03 10:52:21 mpi Exp $ */
+/* $OpenBSD: tcp_usrreq.c,v 1.142 2017/01/10 09:01:18 mpi Exp $ */
/* $NetBSD: tcp_usrreq.c,v 1.20 1996/02/13 23:44:16 christos Exp $ */
/*
@@ -569,8 +569,7 @@ tcp_ctloutput(int op, struct socket *so, int level, int optname,
error = ENOPROTOOPT;
break;
}
- if (m)
- (void) m_free(m);
+ m_free(m);
break;
case PRCO_GETOPT:
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
index 474b4c71bcd..7772997fa6e 100644
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip6_output.c,v 1.218 2016/11/18 02:53:47 dlg Exp $ */
+/* $OpenBSD: ip6_output.c,v 1.219 2017/01/10 09:01:18 mpi Exp $ */
/* $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $ */
/*
@@ -1414,8 +1414,7 @@ do { \
error = ENOPROTOOPT;
break;
}
- if (m)
- (void)m_free(m);
+ m_free(m);
break;
case PRCO_GETOPT:
diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c
index 58cb0e34ab7..0bf46188860 100644
--- a/sys/netinet6/raw_ip6.c
+++ b/sys/netinet6/raw_ip6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: raw_ip6.c,v 1.101 2016/12/22 11:04:44 rzalamena Exp $ */
+/* $OpenBSD: raw_ip6.c,v 1.102 2017/01/10 09:01:18 mpi Exp $ */
/* $KAME: raw_ip6.c,v 1.69 2001/03/04 15:55:44 itojun Exp $ */
/*
@@ -530,8 +530,7 @@ rip6_ctloutput(int op, struct socket *so, int level, int optname,
case MRT6_DEL_MFC:
if (op == PRCO_SETOPT) {
error = ip6_mrouter_set(optname, so, *mp);
- if (*mp)
- (void)m_free(*mp);
+ m_free(*mp);
} else if (op == PRCO_GETOPT)
error = ip6_mrouter_get(optname, so, mp);
else