Browse Source

[fix] libft: tabdel: prevent segfault if tab null.

Moul 3 years ago
parent
commit
7de8a1f4dc
1 changed files with 2 additions and 0 deletions
  1. 2 0
      libft/src/ft_tabdel.c

+ 2 - 0
libft/src/ft_tabdel.c

@@ -22,6 +22,8 @@ void	ft_tabdel(char **tabe)
 	int		i;
 
 	i = -1;
+	if (tabe == NULL)
+		return ;
 	while (tabe[++i] != NULL)
 		ft_strdel(&tabe[i]);
 	free(tabe);