Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Benoit
minishell
Commits
a7c8219d
Commit
a7c8219d
authored
Jan 22, 2021
by
abenoit
Browse files
double free parse input
parent
3d792b7d
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/parsing/parse_input.c
View file @
a7c8219d
...
...
@@ -168,7 +168,7 @@ int parse_input(char **line, char **env, int stat_loc, t_command *command)
if
(
*
line
==
NULL
)
break
;
}
free
(
machine
.
cur_arg
);
//
free(machine.cur_arg);
//Double free, remove this one ?
command
->
pipe_flag
=
machine
.
pipe_flag
;
command
->
redir_paths
=
machine
.
redir_paths
;
command
->
redir_types
=
machine
.
redir_types
;
...
...
src/parsing/parse_utils.c
View file @
a7c8219d
...
...
@@ -164,8 +164,7 @@ int add_arg(t_state_machine *machine)
else
if
(
machine
->
cur_token_stack
==
&
machine
->
redir_paths
)
{
machine
->
redir_types
[
0
]
=
AMBIG
;
free
(
machine
->
cur_arg
);
// Double free
machine
->
cur_arg
=
NULL
;
// Double free
free
(
machine
->
cur_arg
);
// Double free with parse input, remove this one ?
return
(
FAILURE
);
}
return
(
SUCCESS
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment