ft_lstclear fonctionne avec une function dell null, joinfree free les deux elements, gnl dup l'element qui sera free par joinfree

This commit is contained in:
hugogogo
2021-06-27 13:31:43 +02:00
parent f1ce5b8b9e
commit 26147eeeeb
6 changed files with 9 additions and 8 deletions

View File

@@ -12,7 +12,7 @@
/*
** create a new string by concatenating the two strings s1 and s2
** then free s1
** then free s1 and s2
*/
#include "libft.h"
@@ -24,5 +24,6 @@ char *ft_strjoinfree(char *s1, char *s2)
if (!(str = ft_strjoin(s1, s2)))
return (NULL);
free(s1);
free(s2);
return (str);
}