aboutsummaryrefslogtreecommitdiff
path: root/sys/netipsec/key.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netipsec/key.c')
-rw-r--r--sys/netipsec/key.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c
index d54427410b92..82a84a412538 100644
--- a/sys/netipsec/key.c
+++ b/sys/netipsec/key.c
@@ -7164,7 +7164,7 @@ key_register(struct socket *so, struct mbuf *m, const struct sadb_msghdr *mhp)
return key_senderror(so, m, ENOBUFS);
MGETHDR(n, M_NOWAIT, MT_DATA);
- if (len > MHLEN) {
+ if (n != NULL && len > MHLEN) {
if (!(MCLGET(n, M_NOWAIT))) {
m_freem(n);
n = NULL;