libft/ft_free_array.c
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_free_array.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jlasne <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/03 11:27:17 by jlasne #+# #+# */
/* Updated: 2017/03/03 11:49:08 by jlasne ### ########.fr */
/* */
/* ************************************************************************** */
#include "includes/libft.h"
int ft_free_array(char **arr)
{
int i;
if (arr == NULL)
return (1);
i = 0;
while (arr[i] != NULL)
{
free(arr[i]);
i++;
}
if (arr != NULL)
free(arr);
return (1);
}