Fixed overallocation of _thread_fd_table.

PR:		3494
Submitted by:	Steve Bauer <sbauer@rock.sdsmt.edu>
This commit is contained in:
Alexander Langer 1997-05-13 23:54:22 +00:00
parent 8d9b7b9e3f
commit 9c49eac672
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=25795
3 changed files with 3 additions and 3 deletions

View File

@ -183,7 +183,7 @@ _thread_init(void)
PANIC("Cannot get dtablesize");
}
/* Allocate memory for the file descriptor table: */
if ((_thread_fd_table = (struct fd_table_entry **) malloc(sizeof(struct fd_table_entry) * _thread_dtablesize)) == NULL) {
if ((_thread_fd_table = (struct fd_table_entry **) malloc(sizeof(struct fd_table_entry *) * _thread_dtablesize)) == NULL) {
/*
* Cannot allocate memory for the file descriptor
* table, so abort this process.

View File

@ -183,7 +183,7 @@ _thread_init(void)
PANIC("Cannot get dtablesize");
}
/* Allocate memory for the file descriptor table: */
if ((_thread_fd_table = (struct fd_table_entry **) malloc(sizeof(struct fd_table_entry) * _thread_dtablesize)) == NULL) {
if ((_thread_fd_table = (struct fd_table_entry **) malloc(sizeof(struct fd_table_entry *) * _thread_dtablesize)) == NULL) {
/*
* Cannot allocate memory for the file descriptor
* table, so abort this process.

View File

@ -183,7 +183,7 @@ _thread_init(void)
PANIC("Cannot get dtablesize");
}
/* Allocate memory for the file descriptor table: */
if ((_thread_fd_table = (struct fd_table_entry **) malloc(sizeof(struct fd_table_entry) * _thread_dtablesize)) == NULL) {
if ((_thread_fd_table = (struct fd_table_entry **) malloc(sizeof(struct fd_table_entry *) * _thread_dtablesize)) == NULL) {
/*
* Cannot allocate memory for the file descriptor
* table, so abort this process.