Update stack argument initialization behaviour to terminate creation of process on failing memory allocations
This commit is contained in:
@@ -106,7 +106,15 @@ start_process (void *file_name_)
|
||||
push_to_stack (&if_.esp, arg, (strlen (arg) + 1) * sizeof (char));
|
||||
|
||||
struct arg_elem *arg_elem = malloc (sizeof (struct arg_elem));
|
||||
ASSERT (arg_elem != NULL);
|
||||
if (arg_elem == NULL)
|
||||
{
|
||||
printf("ERROR: Couldn't allocate argument pointer memory for %s!\n",
|
||||
file_name);
|
||||
palloc_free_page (file_name_);
|
||||
if (success) process_exit ();
|
||||
thread_exit ();
|
||||
}
|
||||
|
||||
arg_elem->arg = arg;
|
||||
list_push_front (&arg_list, &arg_elem->elem);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user