feat(gnl): adding the gnl free buffer in exit case
This commit is contained in:
parent
eb471f74f4
commit
8e4703da55
1 changed files with 29 additions and 0 deletions
29
gnl/get_next_line_free.c
Normal file
29
gnl/get_next_line_free.c
Normal 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;
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue