removed leaks

This commit is contained in:
Theo Champion 2025-06-25 18:08:19 +02:00
parent c1484d2d3c
commit 2c009b5469
10 changed files with 67 additions and 31 deletions

42
src/utils/frees.c Normal file
View file

@ -0,0 +1,42 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* frees.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tchampio <tchampio@student.42lehavre. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/06/25 17:46:01 by tchampio #+# #+# */
/* Updated: 2025/06/25 18:01:29 by tchampio ### ########.fr */
/* */
/* ************************************************************************** */
#include "../../includes/cub3d_consts.h"
#include "../../includes/structs.h"
#include <stdlib.h>
void free_tab(char **tab)
{
int i;
if (!tab)
return ;
i = 0;
while (tab[i])
{
free(tab[i]);
i++;
}
free(tab);
}
void free_map(t_mapdata *map)
{
free_tab(map->map);
free_tab(map->mapflood);
free(map->ea_texture);
free(map->no_texture);
free(map->so_texture);
free(map->we_texture);
free(map->filename);
free(map);
}