diff options
author | 2016-11-29 10:22:30 +0000 | |
---|---|---|
committer | 2016-11-29 10:22:30 +0000 | |
commit | d03b33115bbcee28ec1dddca742f0e2b8bb58968 (patch) | |
tree | 57683ff86d1d0885c73e6edc7796923424b5e3e4 /sys/kern/uipc_socket.c | |
parent | Remove debugging code that was always enabled and printed parsed (diff) | |
download | wireguard-openbsd-d03b33115bbcee28ec1dddca742f0e2b8bb58968.tar.xz wireguard-openbsd-d03b33115bbcee28ec1dddca742f0e2b8bb58968.zip |
m_free() and m_freem() test for NULL. Simplify callers which had their own
NULL tests.
ok mpi@
Diffstat (limited to 'sys/kern/uipc_socket.c')
-rw-r--r-- | sys/kern/uipc_socket.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 691ae2fb4f0..bc124753cc8 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_socket.c,v 1.167 2016/11/23 13:05:53 bluhm Exp $ */ +/* $OpenBSD: uipc_socket.c,v 1.168 2016/11/29 10:22:30 jsg Exp $ */ /* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */ /* @@ -500,10 +500,8 @@ release: so->so_state &= ~SS_ISSENDING; sbunlock(&so->so_snd); out: - if (top) - m_freem(top); - if (control) - m_freem(control); + m_freem(top); + m_freem(control); return (error); } @@ -664,8 +662,7 @@ soreceive(struct socket *so, struct mbuf **paddr, struct uio *uio, m = m_free(m); } while (uio->uio_resid && error == 0 && m); bad: - if (m) - m_freem(m); + m_freem(m); return (error); } if (mp) |