fixe some leaks
This commit is contained in:
parent
65013fcae6
commit
dbdf84c00f
5 changed files with 22 additions and 5 deletions
|
|
@ -84,6 +84,7 @@ exec/ft_findexec.c\
|
|||
exec/is_function.c\
|
||||
exec/mark_process_status.c\
|
||||
exec/node_copy.c\
|
||||
exec/op_stack_free.c\
|
||||
exec/pfree_cmd.c\
|
||||
exec/pfree_cond.c\
|
||||
exec/pfree_list.c\
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/11/27 20:29:56 by jhalford #+# #+# */
|
||||
/* Updated: 2017/03/15 01:07:00 by ariard ### ########.fr */
|
||||
/* Updated: 2017/03/15 16:06:24 by gwojda ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -133,6 +133,8 @@ struct s_exec
|
|||
int control_count;
|
||||
};
|
||||
|
||||
void op_stack_free(void *data, size_t content_size);
|
||||
|
||||
int exec_reset(void);
|
||||
int process_setgroup(t_process *p, pid_t pid);
|
||||
void process_setsig(void);
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* exec_semi.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/11/30 20:52:05 by jhalford #+# #+# */
|
||||
/* Updated: 2017/03/10 14:55:05 by ariard ### ########.fr */
|
||||
/* Updated: 2017/03/15 15:55:43 by gwojda ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,24 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* instruction_free.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/03/15 15:54:59 by gwojda #+# #+# */
|
||||
/* Updated: 2017/03/15 16:06:34 by gwojda ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "minishell.h"
|
||||
|
||||
int instruction_free(t_list **token, t_parser *parser, t_btree **ast)
|
||||
{
|
||||
{
|
||||
ft_lstdel(token, &token_free);
|
||||
token = NULL;
|
||||
ft_lstdel(&parser->stack, NULL);
|
||||
btree_del(ast, &ast_free);
|
||||
ft_lstdel(&data_singleton()->heredoc_queue, &redir_free);
|
||||
ft_lstdel(&data_singleton()->exec.op_stack, &op_stack_free);
|
||||
return (0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/12/06 18:40:58 by jhalford #+# #+# */
|
||||
/* Updated: 2017/03/15 13:46:36 by gwojda ### ########.fr */
|
||||
/* Updated: 2017/03/15 16:12:35 by gwojda ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -74,6 +74,7 @@ int handle_instruction(int fd)
|
|||
if (ft_exec(&ast))
|
||||
return (2);
|
||||
instruction_free(&token, &parser, &ast);
|
||||
ft_lstdel(&parser.stack, &op_stack_free);
|
||||
if (SH_IS_INTERACTIVE(data_singleton()->opts) && *lexer.str)
|
||||
ft_add_str_in_history(lexer.str);
|
||||
ft_strdel(&lexer.str);
|
||||
|
|
|
|||
Loading…
Reference in a new issue