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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user