]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
Use calloc() instead of malloc + memset.
authordelphij <delphij@FreeBSD.org>
Tue, 29 Sep 2015 04:47:31 +0000 (04:47 +0000)
committerdelphij <delphij@FreeBSD.org>
Tue, 29 Sep 2015 04:47:31 +0000 (04:47 +0000)
MFC after: 2 weeks

lib/libc/gen/fts-compat.c

index 313431a3781747910a338dcd47b90c7efdc53696..51b6c261e5799e0097489f7ff77642df317be21c 100644 (file)
@@ -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;