From c17573ee9702dec04c22800564e72ece76ab386b Mon Sep 17 00:00:00 2001 From: Rudy Bousset Date: Mon, 27 Jan 2020 19:25:52 +0100 Subject: Not normed but ok --- src/ft_get_map.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ft_get_map.c b/src/ft_get_map.c index e41ffd6..a57e32e 100644 --- a/src/ft_get_map.c +++ b/src/ft_get_map.c @@ -76,7 +76,12 @@ ft_get_map(int fd, t_cub *clist) while (ret > 0) { ret = get_next_line(fd, &line); - ft_check_err(line, len); + if (ft_check_err(line, len) < 0) + { + ft_memdel(line); + ft_memdel(mapl); + return (-1); + } mapl = (char*)ft_nrealloc(mapl, (((len / 2) + 2) * i) * sizeof(char), ((((len / 2) + 2) * i) + (ft_strlen(line) / 2) + 2) * sizeof(char)); ft_linecpy(line, mapl, ((len / 2) + 2) * i); -- cgit v1.2.3