fixing leaks
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/03/15 18:37:44 by aortigos #+# #+# */
|
||||
/* Updated: 2025/12/09 19:59:07 by aortigos ### ########.fr */
|
||||
/* Updated: 2026/01/25 16:06:30 by aortigos ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -47,6 +47,12 @@ char *get_next_line(int fd)
|
||||
char *line;
|
||||
static char *left_str;
|
||||
|
||||
if (fd == -1)
|
||||
{
|
||||
free(left_str);
|
||||
left_str = NULL;
|
||||
return (NULL);
|
||||
}
|
||||
if (fd < 0 || BUFFER_SIZE <= 0)
|
||||
{
|
||||
return (0);
|
||||
|
||||
Reference in New Issue
Block a user