Browse Source

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

Moul 2 years ago
parent
commit
f7d8d3749c
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/ft_tabdel.c

+ 2 - 0
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);