Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Jul 2011 06:16:16 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r224489 - stable/8/usr.sbin/mountd
Message-ID:  <201107290616.p6T6GGq6035522@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: delphij
Date: Fri Jul 29 06:16:16 2011
New Revision: 224489
URL: http://svn.freebsd.org/changeset/base/224489

Log:
  Use calloc() instead of an explicit memset.

Modified:
  stable/8/usr.sbin/mountd/mountd.c
Directory Properties:
  stable/8/usr.sbin/mountd/   (props changed)

Modified: stable/8/usr.sbin/mountd/mountd.c
==============================================================================
--- stable/8/usr.sbin/mountd/mountd.c	Fri Jul 29 06:15:18 2011	(r224488)
+++ stable/8/usr.sbin/mountd/mountd.c	Fri Jul 29 06:16:16 2011	(r224489)
@@ -1789,10 +1789,9 @@ get_exp(void)
 {
 	struct exportlist *ep;
 
-	ep = (struct exportlist *)malloc(sizeof (struct exportlist));
+	ep = (struct exportlist *)calloc(1, sizeof (struct exportlist));
 	if (ep == (struct exportlist *)NULL)
 		out_of_mem();
-	memset(ep, 0, sizeof(struct exportlist));
 	return (ep);
 }
 
@@ -1804,10 +1803,9 @@ get_grp(void)
 {
 	struct grouplist *gp;
 
-	gp = (struct grouplist *)malloc(sizeof (struct grouplist));
+	gp = (struct grouplist *)calloc(1, sizeof (struct grouplist));
 	if (gp == (struct grouplist *)NULL)
 		out_of_mem();
-	memset(gp, 0, sizeof(struct grouplist));
 	return (gp);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201107290616.p6T6GGq6035522>