Avoid double-free. In error cases ipfw(4) frees the mbuf(4), we don't

need to.

PR:		kern/145462
This commit is contained in:
Gleb Smirnoff 2010-07-06 10:45:38 +00:00
parent 6e19f4de12
commit 7418c6e1a9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=209722

View File

@ -265,11 +265,8 @@ ng_ipfw_input(struct mbuf **m0, int dir, struct ip_fw_args *fwa, int tee)
* Node must be loaded and corresponding hook must be present.
*/
if (fw_node == NULL ||
(hook = ng_ipfw_findhook1(fw_node, fwa->rule.info)) == NULL) {
if (tee == 0)
m_freem(*m0);
(hook = ng_ipfw_findhook1(fw_node, fwa->rule.info)) == NULL)
return (ESRCH); /* no hook associated with this rule */
}
/*
* We have two modes: in normal mode we add a tag to packet, which is