disable all lines to fix a memory leak causing a page fault.

This commit is contained in:
Marian Ohligs 2012-09-16 17:32:09 +02:00
parent 78ded06efa
commit 1f53f2d5ae

View file

@ -214,29 +214,29 @@ static void NORETURN do_exit(int arg) {
kfree((void*) tmp, sizeof(vma_t));
}
for (fd = 0; fd < NR_OPEN; fd++) {
if ((curr_task->fildes_table[fd] != NULL) && (curr_task->fildes_table[fd]->count == 1)) {
if (curr_task->fildes_table[fd] != NULL) {
/*
* delete a descriptor from the per-process object
* reference table. If this is not the last reference to the underlying
* object, the object will be ignored.
*/
if (curr_task->fildes_table[fd]->count == 1) {
// kprintf("CLOSE_FS\n");
/* try to close the file */
status = close_fs(curr_task->fildes_table[fd]);
// status = close_fs(curr_task->fildes_table[fd]);
/* close command failed -> return check = errno */
if (BUILTIN_EXPECT(status < 0, 0))
kprintf("Task %u was not able to close file descriptor %i. close_fs returned %d", curr_task->id, fd, -status);
kfree(curr_task->fildes_table[fd], sizeof(fildes_t));
// kfree(curr_task->fildes_table[fd], sizeof(fildes_t));
// curr_task->fildes_table[fd] = NULL;
} else {
curr_task->fildes_table[fd]->count--;
// kprintf("DECREASE REF\n");
// curr_task->fildes_table[fd]->count--;
// curr_task->fildes_table[fd] = NULL;
}
}
}
}
// after closing all file decriptors and cleaning up, the table has to be cleared.
if(!curr_task->fildes_table)