fix leaks

This commit is contained in:
gwojda 2017-03-18 15:43:59 +01:00
parent 40f852345e
commit 6c955a4a44
2 changed files with 6 additions and 5 deletions

View file

@ -6,7 +6,7 @@
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/28 14:28:41 by jhalford #+# #+# */
/* Updated: 2017/03/14 15:22:44 by gwojda ### ########.fr */
/* Updated: 2017/03/18 15:41:42 by gwojda ### ########.fr */
/* */
/* ************************************************************************** */
@ -33,9 +33,6 @@ int builtin_exit(const char *path, char *const av[], char *const envp[])
status = ft_atoi(av[1]);
else
status = ft_atoi(ft_getenv(data_singleton()->env, "?"));
ft_save_termios(-1);
ft_free_hash_table();
free_history_list(data_singleton()->line.list_beg);
if (SH_IS_INTERACTIVE(data_singleton()->opts))
tcsetattr(STDIN, TCSANOW, &data_singleton()->jobc.shell_tmodes);
data_exit();

View file

@ -6,7 +6,7 @@
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/07 18:07:50 by jhalford #+# #+# */
/* Updated: 2017/03/14 15:21:17 by gwojda ### ########.fr */
/* Updated: 2017/03/18 15:43:07 by gwojda ### ########.fr */
/* */
/* ************************************************************************** */
@ -19,6 +19,10 @@ void data_exit(void)
data = data_singleton();
/* ft_strdel(&data->line.input); */
ft_sstrfree(data->env);
ft_sstrfree(data->local_var);
ft_sstrfree(data->argv);
ft_save_termios(-1);
ft_free_hash_table();
free_history_list(data_singleton()->line.list_beg);
free(data_singleton());
}