aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLutz Donnerhacke <donner@FreeBSD.org>2021-05-15 09:32:57 +0000
committerLutz Donnerhacke <donner@FreeBSD.org>2021-05-23 13:01:34 +0000
commit6bc3535519f7206f844c3ffd0ee282e8875dceb4 (patch)
tree0d4d88db902648b45d1b39337886829a1886f311
parent271f9f2e8b93f0724d00b5405f8b53f6695408b2 (diff)
downloadsrc-6bc3535519f7206f844c3ffd0ee282e8875dceb4.tar.gz
src-6bc3535519f7206f844c3ffd0ee282e8875dceb4.zip
netgraph/ng_checksum: Fix double free error
m_pullup(9) frees the mbuf(9) chain in the case of an allocation error. The mbuf chain must not be freed again in this case. PR: 255874 Submitted by: <lylgood@foxmail.com> Approved by: markj Differential Revision: https://reviews.freebsd.org/D30273 (cherry picked from commit 687e510e5ce32fddf46a9dc1d517ccc8a8e25581)
-rw-r--r--sys/netgraph/ng_checksum.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/netgraph/ng_checksum.c b/sys/netgraph/ng_checksum.c
index c7fecb0ab78d..0100b7ef3260 100644
--- a/sys/netgraph/ng_checksum.c
+++ b/sys/netgraph/ng_checksum.c
@@ -683,9 +683,9 @@ bypass:
return (error);
done:
+ NG_FREE_M(m);
drop:
NG_FREE_ITEM(item);
- NG_FREE_M(m);
priv->stats.dropped++;