From 288b15d0793936fa14b51ed860056f6ce6200c52 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Thu, 22 Jun 2017 08:26:27 -0400 Subject: Replace malloc+memset with calloc, mostly by using the new ezalloc macro. --- extension/gawkfts.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'extension/gawkfts.c') diff --git a/extension/gawkfts.c b/extension/gawkfts.c index 4a712153..d9edd87f 100644 --- a/extension/gawkfts.c +++ b/extension/gawkfts.c @@ -162,9 +162,8 @@ fts_open(char * const *argv, int options, } /* Allocate/initialize the stream */ - if ((sp = malloc((unsigned int)sizeof(FTS))) == NULL) + if ((sp = calloc(1, (unsigned int)sizeof(FTS))) == NULL) return (NULL); - memset(sp, 0, sizeof(FTS)); sp->fts_compar = compar; sp->fts_options = options; -- cgit v1.2.3