diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2020-10-09 11:20:47 +0200 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2020-10-09 11:20:47 +0200 |
| commit | 6b200dc03c8233f6cd49111540002eb9b5aac4ec (patch) | |
| tree | 5834002464dfbf03ee0d9fd6faea05fa37f8397f /src/main.c | |
| parent | 97e7e9b9934f99fbc659445512b19a525802726c (diff) | |
| download | minishell-6b200dc03c8233f6cd49111540002eb9b5aac4ec.tar.gz minishell-6b200dc03c8233f6cd49111540002eb9b5aac4ec.tar.bz2 minishell-6b200dc03c8233f6cd49111540002eb9b5aac4ec.zip | |
Fixing 2 leaks in get_next_line and parser
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -6,7 +6,7 @@ /* By: cacharle <cacharle@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/02/28 11:45:44 by cacharle #+# #+# */ -/* Updated: 2020/10/08 11:36:46 by cacharle ### ########.fr */ +/* Updated: 2020/10/09 09:39:22 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -81,7 +81,9 @@ int repl(t_env env) return (2); g_child_pid = -1; print_prompt(); + free(line); } + free(line); if (ret != FTGL_EOF) return (2); return (0); @@ -101,7 +103,7 @@ int main(int argc, char **argv, char **envp) if ((env = env_from_array(envp)) == NULL) return (1); setup(argv[0], env); - /* g_state.child_pid = 0; */ + g_state.child_pid = -1; repl(env); ft_vecdestroy(env, free); return (g_state.last_status); |
