fix(setters): added a tiny bit of security when freeing data

This commit is contained in:
Theo Champion 2025-07-22 12:57:39 +02:00
parent 7449450c52
commit 01a8119fe2

View file

@ -6,7 +6,7 @@
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/07/17 13:59:27 by kcolin #+# #+# */
/* Updated: 2025/07/17 15:55:22 by kcolin ### ########.fr */
/* Updated: 2025/07/22 12:54:01 by tchampio ### ########.fr */
/* */
/* ************************************************************************** */
@ -48,12 +48,19 @@ void free_tab_length(char **tab, int length)
void free_map(t_mapdata *map)
{
if (map->map)
free_tab(map->map);
if (map->mapflood)
free_tab(map->mapflood);
if (map->ea_texture)
free(map->ea_texture);
if (map->no_texture)
free(map->no_texture);
if (map->so_texture)
free(map->so_texture);
if (map->we_texture)
free(map->we_texture);
if (map->filename)
free(map->filename);
free(map);
}