From 9c49eac6721bbbb72ffa6f62fb1d2f1f6b0b8d7f Mon Sep 17 00:00:00 2001 From: Alexander Langer Date: Tue, 13 May 1997 23:54:22 +0000 Subject: [PATCH] Fixed overallocation of _thread_fd_table. PR: 3494 Submitted by: Steve Bauer --- lib/libc_r/uthread/uthread_init.c | 2 +- lib/libkse/thread/thr_init.c | 2 +- lib/libpthread/thread/thr_init.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libc_r/uthread/uthread_init.c b/lib/libc_r/uthread/uthread_init.c index 2adc34f152c1..5833cdfcacec 100644 --- a/lib/libc_r/uthread/uthread_init.c +++ b/lib/libc_r/uthread/uthread_init.c @@ -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. diff --git a/lib/libkse/thread/thr_init.c b/lib/libkse/thread/thr_init.c index 2adc34f152c1..5833cdfcacec 100644 --- a/lib/libkse/thread/thr_init.c +++ b/lib/libkse/thread/thr_init.c @@ -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. diff --git a/lib/libpthread/thread/thr_init.c b/lib/libpthread/thread/thr_init.c index 2adc34f152c1..5833cdfcacec 100644 --- a/lib/libpthread/thread/thr_init.c +++ b/lib/libpthread/thread/thr_init.c @@ -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.