svn commit: r224003 - head/usr.sbin/mountd

Xin LI delphij at FreeBSD.org
Thu Jul 14 07:35:29 UTC 2011


Author: delphij
Date: Thu Jul 14 07:35:28 2011
New Revision: 224003
URL: http://svn.freebsd.org/changeset/base/224003

Log:
  Use calloc() instead of an explicit memset.
  
  MFC after:	2 weeks

Modified:
  head/usr.sbin/mountd/mountd.c

Modified: head/usr.sbin/mountd/mountd.c
==============================================================================
--- head/usr.sbin/mountd/mountd.c	Thu Jul 14 07:33:53 2011	(r224002)
+++ head/usr.sbin/mountd/mountd.c	Thu Jul 14 07:35:28 2011	(r224003)
@@ -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);
 }
 


More information about the svn-src-all mailing list