From owner-svn-src-all@FreeBSD.ORG Tue Jul 6 10:45:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECA7C106566C; Tue, 6 Jul 2010 10:45:38 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DC06D8FC19; Tue, 6 Jul 2010 10:45:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o66AjcQt044855; Tue, 6 Jul 2010 10:45:38 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o66AjcUW044853; Tue, 6 Jul 2010 10:45:38 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201007061045.o66AjcUW044853@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 6 Jul 2010 10:45:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209722 - head/sys/netgraph X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 10:45:39 -0000 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