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
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D30273
This commit is contained in:
Lutz Donnerhacke 2021-05-15 11:32:57 +02:00
parent 8252fe56a0
commit 687e510e5c

View File

@ -682,9 +682,9 @@ ng_checksum_rcvdata(hook_p hook, item_p item)
return (error);
done:
NG_FREE_M(m);
drop:
NG_FREE_ITEM(item);
NG_FREE_M(m);
priv->stats.dropped++;