Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Sep 2015 04:47:32 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r288351 - head/lib/libc/gen
Message-ID:  <201509290447.t8T4lWjl074244@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: delphij
Date: Tue Sep 29 04:47:31 2015
New Revision: 288351
URL: https://svnweb.freebsd.org/changeset/base/288351

Log:
  Use calloc() instead of malloc + memset.
  
  MFC after:	2 weeks

Modified:
  head/lib/libc/gen/fts-compat.c

Modified: head/lib/libc/gen/fts-compat.c
==============================================================================
--- head/lib/libc/gen/fts-compat.c	Tue Sep 29 03:40:21 2015	(r288350)
+++ head/lib/libc/gen/fts-compat.c	Tue Sep 29 04:47:31 2015	(r288351)
@@ -137,9 +137,8 @@ __fts_open_44bsd(char * const *argv, int
 	}
 
 	/* Allocate/initialize the stream. */
-	if ((priv = malloc(sizeof(*priv))) == NULL)
+	if ((priv = calloc(1, sizeof(*priv))) == NULL)
 		return (NULL);
-	memset(priv, 0, sizeof(*priv));
 	sp = &priv->ftsp_fts;
 	sp->fts_compar = compar;
 	sp->fts_options = options;



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