Date: Thu, 8 Dec 2005 20:00:47 +0100 (CET) From: Antoine Brodin <antoine.brodin@laposte.net> To: FreeBSD-gnats-submit@FreeBSD.org Subject: kern/90113: [patch] memory leak in ng_hole(4) Message-ID: <200512081900.jB8J0lM6024709@barton.dreadbsd.org> Resent-Message-ID: <200512081910.jB8JA3qV078632@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200512081900.jB8J0lM6024709>
