diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-09-30 20:19:44 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-09-30 20:19:44 -0700 |
commit | 283b9a2a9da3ad662789d1127a486c8735589f73 (patch) | |
tree | 44332b48c0986bc3e589957b658e7def10fae84e | |
parent | 4acfec7c03865144491f913694f8dca17072d13e (diff) |
Use calloc() instead of malloc(); bzero();
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
-rw-r--r-- | fd.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -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++) |