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. --- io.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'io.c') diff --git a/io.c b/io.c index e08c3373..5d79e170 100644 --- a/io.c +++ b/io.c @@ -2803,8 +2803,7 @@ init_awkpath(path_info *pi) max_path++; // +3 --> 2 for null entries at front and end of path, 1 for NULL end of list - emalloc(pi->awkpath, char **, (max_path + 3) * sizeof(char *), "init_awkpath"); - memset(pi->awkpath, 0, (max_path + 3) * sizeof(char *)); + ezalloc(pi->awkpath, char **, (max_path + 3) * sizeof(char *), "init_awkpath"); start = path; i = 0; @@ -3211,9 +3210,8 @@ iop_alloc(int fd, const char *name, int errno_val) { IOBUF *iop; - emalloc(iop, IOBUF *, sizeof(IOBUF), "iop_alloc"); + ezalloc(iop, IOBUF *, sizeof(IOBUF), "iop_alloc"); - memset(iop, '\0', sizeof(IOBUF)); iop->public.fd = fd; iop->public.name = name; iop->public.read_func = ( ssize_t(*)() ) read; -- cgit v1.2.3