Libft extra functions
This commit is contained in:
26
lib/libft/ft_memfree_all.c
Normal file
26
lib/libft/ft_memfree_all.c
Normal file
@@ -0,0 +1,26 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_memfree_all.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/09/22 20:46:43 by aortigos #+# #+# */
|
||||
/* Updated: 2025/11/16 19:04:45 by aortigos ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
|
||||
void free2d(char **ptr)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!ptr)
|
||||
return ;
|
||||
i = 0;
|
||||
while (ptr[i])
|
||||
ft_memfree(ptr[i++]);
|
||||
free(ptr);
|
||||
ptr = NULL;
|
||||
}
|
||||
Reference in New Issue
Block a user