From owner-svn-src-head@FreeBSD.ORG Mon Jun 29 18:09:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1587A106564A; Mon, 29 Jun 2009 18:09:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 042908FC24; Mon, 29 Jun 2009 18:09:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5TI97kU051660; Mon, 29 Jun 2009 18:09:07 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5TI97rZ051658; Mon, 29 Jun 2009 18:09:07 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200906291809.n5TI97rZ051658@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 29 Jun 2009 18:09:07 +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: r195166 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jun 2009 18:09:08 -0000 Author: kib Date: Mon Jun 29 18:09:07 2009 New Revision: 195166 URL: http://svn.freebsd.org/changeset/base/195166 Log: Free struct ucreds allocated in vfs_hang_addrlist() when deleting the export element. While there, remove register storage-class specifiers. Reported and tested by: pho Reviewed by: kan Approved by: re (kensmith) Modified: head/sys/kern/vfs_export.c Modified: head/sys/kern/vfs_export.c ============================================================================== --- head/sys/kern/vfs_export.c Mon Jun 29 17:36:47 2009 (r195165) +++ head/sys/kern/vfs_export.c Mon Jun 29 18:09:07 2009 (r195166) @@ -220,9 +220,13 @@ out: static int vfs_free_netcred(struct radix_node *rn, void *w) { - register struct radix_node_head *rnh = (struct radix_node_head *) w; + struct radix_node_head *rnh = (struct radix_node_head *) w; + struct ucred *cred; (*rnh->rnh_deladdr) (rn->rn_key, rn->rn_mask, rnh); + cred = ((struct netcred *)rn)->netc_anon; + if (cred != NULL) + crfree(cred); free(rn, M_NETADDR); return (0); } @@ -233,10 +237,11 @@ vfs_free_netcred(struct radix_node *rn, static void vfs_free_addrlist(struct netexport *nep) { - register int i; - register struct radix_node_head *rnh; + int i; + struct radix_node_head *rnh; + struct ucred *cred; - for (i = 0; i <= AF_MAX; i++) + for (i = 0; i <= AF_MAX; i++) { if ((rnh = nep->ne_rtable[i])) { RADIX_NODE_HEAD_LOCK(rnh); (*rnh->rnh_walktree) (rnh, vfs_free_netcred, rnh); @@ -245,6 +250,11 @@ vfs_free_addrlist(struct netexport *nep) free(rnh, M_RTABLE); nep->ne_rtable[i] = NULL; /* not SMP safe XXX */ } + } + cred = nep->ne_defexported.netc_anon; + if (cred != NULL) + crfree(cred); + } /*