Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Jul 2010 10:45:38 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r209722 - head/sys/netgraph
Message-ID:  <201007061045.o66AjcUW044853@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Tue Jul  6 10:45:38 2010
New Revision: 209722
URL: http://svn.freebsd.org/changeset/base/209722

Log:
  Avoid double-free. In error cases ipfw(4) frees the mbuf(4), we don't
  need to.
  
  PR:		kern/145462

Modified:
  head/sys/netgraph/ng_ipfw.c

Modified: head/sys/netgraph/ng_ipfw.c
==============================================================================
--- head/sys/netgraph/ng_ipfw.c	Tue Jul  6 10:28:19 2010	(r209721)
+++ head/sys/netgraph/ng_ipfw.c	Tue Jul  6 10:45:38 2010	(r209722)
@@ -265,11 +265,8 @@ ng_ipfw_input(struct mbuf **m0, int dir,
 	 * 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201007061045.o66AjcUW044853>