diff options
author | Xin LI <delphij@FreeBSD.org> | 2015-09-29 04:47:31 +0000 |
---|---|---|
committer | Xin LI <delphij@FreeBSD.org> | 2015-09-29 04:47:31 +0000 |
commit | 55b2d6330911f1f1f3c156ad1b15b51395c7e1a7 (patch) | |
tree | 1225ba31f5898069b5e7a8c09dfbc908d0126a4c /lib/libc | |
parent | dd2fb488aa0cc58d666ae682b6c9d0e8eedcb747 (diff) | |
download | src-55b2d6330911f1f1f3c156ad1b15b51395c7e1a7.tar.gz src-55b2d6330911f1f1f3c156ad1b15b51395c7e1a7.zip |
Use calloc() instead of malloc + memset.
MFC after: 2 weeks
Notes
Notes:
svn path=/head/; revision=288351
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/gen/fts-compat.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/libc/gen/fts-compat.c b/lib/libc/gen/fts-compat.c index 313431a37817..51b6c261e579 100644 --- a/lib/libc/gen/fts-compat.c +++ b/lib/libc/gen/fts-compat.c @@ -137,9 +137,8 @@ __fts_open_44bsd(char * const *argv, int options, } /* 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; |