feat(gnl): adding the gnl free buffer in exit case

This commit is contained in:
Raphael 2025-12-11 15:33:02 +01:00 committed by Raphaël
parent eb471f74f4
commit 8e4703da55

29
gnl/get_next_line_free.c Normal file
View file

@ -0,0 +1,29 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* get_next_line_free.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/11/28 00:40:01 by rparodi #+# #+# */
/* Updated: 2025/11/28 00:50:15 by rparodi ### ########.fr */
/* */
/* ************************************************************************** */
#include "gnl.h"
char **memory_storage(void)
{
static char *memory;
return (&memory);
}
void get_next_line_clear(void)
{
char **memory;
memory = memory_storage();
ft_free(*memory);
*memory = NULL;
}