aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorRyan Libby <rlibby@FreeBSD.org>2019-06-25 15:43:52 +0000
committerRyan Libby <rlibby@FreeBSD.org>2019-06-25 15:43:52 +0000
commit0e2464ea18bd17f21eea3336d3462fd912e4218c (patch)
tree79f47066fb51f8943292ca77a3fd8849d4be3440 /sys
parent343a7eabf30393a4ee7b51469ddc804b9ac132a4 (diff)
downloadsrc-0e2464ea18bd17f21eea3336d3462fd912e4218c.tar.gz
src-0e2464ea18bd17f21eea3336d3462fd912e4218c.zip
netipsec key_register: check for M_NOWAIT alloc failure
Reviewed by: ae, cem Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20742
Notes
Notes: svn path=/head/; revision=349373
Diffstat (limited to 'sys')
-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;