From owner-svn-src-all@FreeBSD.ORG Thu Jul 14 07:35:28 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EADAA1065670; Thu, 14 Jul 2011 07:35:28 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA1998FC0A; Thu, 14 Jul 2011 07:35:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6E7ZS29018989; Thu, 14 Jul 2011 07:35:28 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6E7ZSMA018987; Thu, 14 Jul 2011 07:35:28 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201107140735.p6E7ZSMA018987@svn.freebsd.org> From: Xin LI Date: Thu, 14 Jul 2011 07:35:28 +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: r224003 - head/usr.sbin/mountd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jul 2011 07:35:29 -0000 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); }