fixe some leaks

This commit is contained in:
gwojda 2017-03-15 16:38:04 +01:00
parent 5d37f0e720
commit 10ff285727
6 changed files with 13 additions and 14 deletions

View file

@ -84,7 +84,6 @@ 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\
@ -265,6 +264,7 @@ line-editing/print_and_del.c\
line-editing/queue.c\
line-editing/readline.c\
line-editing/resize.c\
main/content_free.c\
main/data_exit.c\
main/data_init.c\
main/data_singleton.c\

View file

@ -6,7 +6,7 @@
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/27 20:29:56 by jhalford #+# #+# */
/* Updated: 2017/03/15 16:06:24 by gwojda ### ########.fr */
/* Updated: 2017/03/15 16:35:30 by gwojda ### ########.fr */
/* */
/* ************************************************************************** */
@ -133,8 +133,6 @@ 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);

View file

@ -6,7 +6,7 @@
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/10 13:07:44 by jhalford #+# #+# */
/* Updated: 2017/03/14 21:34:13 by jhalford ### ########.fr */
/* Updated: 2017/03/15 16:35:42 by gwojda ### ########.fr */
/* */
/* ************************************************************************** */
@ -54,6 +54,7 @@ void data_exit(void);
int instruction_free(t_list **token, t_parser *parser,
t_btree **ast);
void content_free(void *data, size_t content_size);
char *ft_putast(void *node);
void ft_putast2(void *node);

View file

@ -6,7 +6,7 @@
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/02/21 21:05:23 by ariard #+# #+# */
/* Updated: 2017/03/08 18:33:31 by ariard ### ########.fr */
/* Updated: 2017/03/15 16:31:49 by gwojda ### ########.fr */
/* */
/* ************************************************************************** */
@ -19,5 +19,6 @@ int insert_newline(t_list **alst)
token = token_init();
token->type = TK_NEWLINE;
ft_lsteadd(alst, ft_lstnew(token, sizeof(*token)));
free(token);
return (0);
}

View file

@ -6,7 +6,7 @@
/* 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 */
/* Updated: 2017/03/15 16:36:14 by gwojda ### ########.fr */
/* */
/* ************************************************************************** */
@ -16,9 +16,10 @@ 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(&parser->stack, &content_free);
btree_del(ast, &content_free);
ft_lstdel(&data_singleton()->heredoc_queue, &redir_free);
ft_lstdel(&data_singleton()->exec.op_stack, &op_stack_free);
ft_lstdel(&data_singleton()->exec.op_stack, &content_free);
free(parser->new_sym);
return (0);
}

View file

@ -6,7 +6,7 @@
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/06 18:40:58 by jhalford #+# #+# */
/* Updated: 2017/03/15 16:12:35 by gwojda ### ########.fr */
/* Updated: 2017/03/15 16:33:07 by gwojda ### ########.fr */
/* */
/* ************************************************************************** */
@ -74,11 +74,9 @@ 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);
free(parser.new_sym);
return (0);
}