Commit a7c8219d authored by abenoit's avatar abenoit
Browse files

double free parse input

parent 3d792b7d
...@@ -168,7 +168,7 @@ int parse_input(char **line, char **env, int stat_loc, t_command *command) ...@@ -168,7 +168,7 @@ int parse_input(char **line, char **env, int stat_loc, t_command *command)
if (*line == NULL) if (*line == NULL)
break ; break ;
} }
free(machine.cur_arg); // free(machine.cur_arg); //Double free, remove this one ?
command->pipe_flag = machine.pipe_flag; command->pipe_flag = machine.pipe_flag;
command->redir_paths = machine.redir_paths; command->redir_paths = machine.redir_paths;
command->redir_types = machine.redir_types; command->redir_types = machine.redir_types;
......
...@@ -164,8 +164,7 @@ int add_arg(t_state_machine *machine) ...@@ -164,8 +164,7 @@ int add_arg(t_state_machine *machine)
else if (machine->cur_token_stack == &machine->redir_paths) else if (machine->cur_token_stack == &machine->redir_paths)
{ {
machine->redir_types[0] = AMBIG; machine->redir_types[0] = AMBIG;
free(machine->cur_arg); // Double free free(machine->cur_arg); // Double free with parse input, remove this one ?
machine->cur_arg = NULL; // Double free
return (FAILURE); return (FAILURE);
} }
return (SUCCESS); return (SUCCESS);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment