fix: fixed double free on cleanup call -> used ft_free to set ptr to

null
This commit is contained in:
B.Goulard 2024-11-11 21:40:34 +01:00
parent 3e21d3d710
commit 15d7738baf
2 changed files with 5 additions and 7 deletions

View file

@ -6,18 +6,17 @@
/* By: bgoulard <bgoulard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/11/09 01:11:01 by bgoulard #+# #+# */
/* Updated: 2024/11/09 01:11:45 by bgoulard ### ########.fr */
/* Updated: 2024/11/11 21:30:19 by bgoulard ### ########.fr */
/* */
/* ************************************************************************** */
#include "cub3d_struct.h"
#include <stdlib.h>
#include "ft_string.h"
static void cleanup_cli(t_cli *cli_ctx)
{
if (cli_ctx->file)
free(cli_ctx->file);
ft_free((void **)&cli_ctx->file);
}
static void cleanup_map(t_map *map)

View file

@ -6,7 +6,7 @@
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/30 16:30:03 by rparodi #+# #+# */
/* Updated: 2024/11/11 20:01:31 by rparodi ### ########.fr */
/* Updated: 2024/11/11 21:34:07 by bgoulard ### ########.fr */
/* */
/* ************************************************************************** */
@ -59,7 +59,6 @@ void run_cub3d(t_info *info)
// - game loop
init_mlx_env(info);
// - mlx cleanup
(void)info;
}
int main_cub3d(char *file_arg, t_info *info)