fix(texture setting): Fixed leak when map starts before all textures are set

This commit is contained in:
Theo Champion 2025-07-22 12:58:10 +02:00 committed by Khaïs COLIN
parent a67010b929
commit af8b63b0ca

View file

@ -6,7 +6,7 @@
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/06/21 19:35:43 by tchampio #+# #+# */
/* Updated: 2025/07/22 12:36:22 by kcolin ### ########.fr */
/* Updated: 2025/07/22 18:37:54 by tchampio ### ########.fr */
/* */
/* ************************************************************************** */
@ -97,7 +97,7 @@ int set_textures(char *line, t_mapdata *map)
tab = ft_split(line, ' ');
if (tab[0][0] == '1')
return (ft_strlcpy(map->error,
return (free_map(map), ft_strlcpy(map->error,
"Map started before all the textures", ERRLEN), 1);
retvalue = 0;
if (tab[0] && tab[1])