svn commit: r238963 - head/lib/libc/gen
Xin LI
delphij at FreeBSD.org
Wed Aug 1 00:21:56 UTC 2012
Author: delphij
Date: Wed Aug 1 00:21:55 2012
New Revision: 238963
URL: http://svn.freebsd.org/changeset/base/238963
Log:
Use calloc().
Modified:
head/lib/libc/gen/fts.c
Modified: head/lib/libc/gen/fts.c
==============================================================================
--- head/lib/libc/gen/fts.c Wed Aug 1 00:18:02 2012 (r238962)
+++ head/lib/libc/gen/fts.c Wed Aug 1 00:21:55 2012 (r238963)
@@ -134,9 +134,8 @@ fts_open(argv, options, compar)
}
/* 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;
More information about the svn-src-all
mailing list