From owner-freebsd-bugs@FreeBSD.ORG Tue Dec 6 03:20:09 2011 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8686106564A for ; Tue, 6 Dec 2011 03:20:09 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 999BA8FC17 for ; Tue, 6 Dec 2011 03:20:09 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id pB63K9sZ083198 for ; Tue, 6 Dec 2011 03:20:09 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id pB63K9b1083197; Tue, 6 Dec 2011 03:20:09 GMT (envelope-from gnats) Resent-Date: Tue, 6 Dec 2011 03:20:09 GMT Resent-Message-Id: <201112060320.pB63K9b1083197@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Herbie Robinson Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B0AE1065670 for ; Tue, 6 Dec 2011 03:16:25 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 5AE7E8FC0A for ; Tue, 6 Dec 2011 03:16:25 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id pB63GOgK045883 for ; Tue, 6 Dec 2011 03:16:24 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id pB63GOjd045882; Tue, 6 Dec 2011 03:16:24 GMT (envelope-from nobody) Message-Id: <201112060316.pB63GOjd045882@red.freebsd.org> Date: Tue, 6 Dec 2011 03:16:24 GMT From: Herbie Robinson To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/163089: Duplicate free in the error return for mld_v2_encap_report in mld6.c X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2011 03:20:09 -0000 >Number: 163089 >Category: kern >Synopsis: Duplicate free in the error return for mld_v2_encap_report in mld6.c >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Dec 06 03:20:09 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Herbie Robinson >Release: 8 >Organization: Stratus Technologies >Environment: This is a port of the IPv6 code to a non-BSD operating system. I [think] I have checked the latest CVS and the problem is still there. >Description: All of this is in src/sys/netinet6/mld6.c The call code is: m0 = mld_v2_encap_report(ifp, m); if (m0 == NULL) { CTR2(KTR_MLD, "%s: dropped %p", __func__, m); m_freem(m); The function mld_v2_encap_report consumes the mbuf in all cases (normal and error return); so, this is duplicate. I haven't been working with the code long enough to know whether the coding philosophy would be to delete the free from the caller or the subroutine. I would be inclined to remove the duplicate free from the caller... I left the priority as low because memory allocation failures are rare these days... >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: