kern/90113: [patch] memory leak in ng_hole(4)

Antoine Brodin antoine.brodin at laposte.net
Thu Dec 8 11:10:31 PST 2005


>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 at 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:


More information about the freebsd-bugs mailing list