From owner-freebsd-bugs@FreeBSD.ORG Thu Dec 8 19:10:31 2005 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8093716A41F for ; Thu, 8 Dec 2005 19:10:31 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9A88A43D78 for ; Thu, 8 Dec 2005 19:10:03 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id jB8JA3m4078633 for ; Thu, 8 Dec 2005 19:10:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id jB8JA3qV078632; Thu, 8 Dec 2005 19:10:03 GMT (envelope-from gnats) Resent-Date: Thu, 8 Dec 2005 19:10:03 GMT Resent-Message-Id: <200512081910.jB8JA3qV078632@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, Antoine Brodin Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B637016A420 for ; Thu, 8 Dec 2005 19:01:07 +0000 (GMT) (envelope-from antoine@peanut.dreadbsd.org) Received: from barton.dreadbsd.org (peanut.dreadbsd.org [82.67.196.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6495343D5D for ; Thu, 8 Dec 2005 19:00:51 +0000 (GMT) (envelope-from antoine@peanut.dreadbsd.org) Received: from barton.dreadbsd.org (localhost [127.0.0.1]) by barton.dreadbsd.org (8.13.4/8.13.4) with ESMTP id jB8J0ltY024710 for ; Thu, 8 Dec 2005 20:00:48 +0100 (CET) (envelope-from antoine@peanut.dreadbsd.org) Received: (from antoine@localhost) by barton.dreadbsd.org (8.13.4/8.13.1/Submit) id jB8J0lM6024709; Thu, 8 Dec 2005 20:00:47 +0100 (CET) (envelope-from antoine) Message-Id: <200512081900.jB8J0lM6024709@barton.dreadbsd.org> Date: Thu, 8 Dec 2005 20:00:47 +0100 (CET) From: Antoine Brodin To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: kern/90113: [patch] memory leak in ng_hole(4) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Antoine Brodin List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2005 19:10:31 -0000 >Number: 90113 >Category: kern >Synopsis: [patch] memory leak in ng_hole(4) >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: Thu Dec 08 19:10:02 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Antoine Brodin >Release: FreeBSD 7.0-CURRENT i386 >Organization: none >Environment: System: FreeBSD barton.dreadbsd.org 7.0-CURRENT FreeBSD 7.0-CURRENT #1: Sat Dec 3 16:06:36 CET 2005 root@barton.dreadbsd.org:/usr/obj/usr/src/sys/BARTON i386 >Description: There's a memory leak in ng_hole(4). When a hook is disconnected, the statistics about this hook are not freed. >How-To-Repeat: Use ng_hole(4). After that, do a `vmstat -m | grep netgraph` after shutting down everything >Fix: --- ng_hole.diff begins here --- Index: netgraph/ng_hole.c =================================================================== RCS file: /home/ncvs/src/sys/netgraph/ng_hole.c,v retrieving revision 1.14 diff -u -p -r1.14 ng_hole.c --- netgraph/ng_hole.c 7 Jan 2005 01:45:39 -0000 1.14 +++ netgraph/ng_hole.c 8 Dec 2005 18:42:13 -0000 @@ -219,6 +219,7 @@ static int ngh_disconnect(hook_p hook) { + FREE(NG_HOOK_PRIVATE(hook), M_NETGRAPH); NG_HOOK_SET_PRIVATE(hook, NULL); if (NG_NODE_NUMHOOKS(NG_HOOK_NODE(hook)) == 0) ng_rmnode_self(NG_HOOK_NODE(hook)); --- ng_hole.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: