From 283b9a2a9da3ad662789d1127a486c8735589f73 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 30 Sep 2011 20:19:44 -0700 Subject: Use calloc() instead of malloc(); bzero(); Signed-off-by: Alan Coopersmith Reviewed-by: Jeremy Huddleston --- fd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'fd.c') diff --git a/fd.c b/fd.c index 395bbbb..50c6f17 100644 --- a/fd.c +++ b/fd.c @@ -105,11 +105,10 @@ InitializeFD(void) } /* allocate space for a File Descriptor (FD) Table */ - FDD = malloc (MaxFD * sizeof (struct FDDescriptor)); + FDD = calloc (MaxFD, sizeof (struct FDDescriptor)); if (FDD == NULL) { panic("Can't allocate memory for file descriptor table"); } - bzero(FDD, (MaxFD * sizeof (struct FDDescriptor))); /* be sure all fd's are closed and marked not busy */ for (i = 0; i < MaxFD; i++) -- cgit v1.2.1