fix: fixed double free on cleanup call -> used ft_free to set ptr to
null
This commit is contained in:
parent
3e21d3d710
commit
15d7738baf
2 changed files with 5 additions and 7 deletions
|
|
@ -6,18 +6,17 @@
|
||||||
/* By: bgoulard <bgoulard@student.42.fr> +#+ +:+ +#+ */
|
/* By: bgoulard <bgoulard@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/11/09 01:11:01 by bgoulard #+# #+# */
|
/* 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 "cub3d_struct.h"
|
||||||
|
#include "ft_string.h"
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
static void cleanup_cli(t_cli *cli_ctx)
|
static void cleanup_cli(t_cli *cli_ctx)
|
||||||
{
|
{
|
||||||
if (cli_ctx->file)
|
if (cli_ctx->file)
|
||||||
free(cli_ctx->file);
|
ft_free((void **)&cli_ctx->file);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cleanup_map(t_map *map)
|
static void cleanup_map(t_map *map)
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/10/30 16:30:03 by rparodi #+# #+# */
|
/* 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
|
// - game loop
|
||||||
init_mlx_env(info);
|
init_mlx_env(info);
|
||||||
// - mlx cleanup
|
// - mlx cleanup
|
||||||
(void)info;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int main_cub3d(char *file_arg, t_info *info)
|
int main_cub3d(char *file_arg, t_info *info)
|
||||||
|
|
@ -80,7 +79,7 @@ int main_cub3d(char *file_arg, t_info *info)
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
t_info info;
|
t_info info;
|
||||||
int parsed_args;
|
int parsed_args;
|
||||||
|
|
||||||
parsed_args = c3_options(&info, argc, argv);
|
parsed_args = c3_options(&info, argc, argv);
|
||||||
if (parsed_args == -1)
|
if (parsed_args == -1)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue