minishell/src/utils/ft_strdup_safe.c
whaffman ab72bd5bbb malloc_safe
- add freelist to minishell
- add t_minishell *minishell to all function calling malloc_free
- substituted all malloc calls but the first to malloc_safe
2025-02-25 14:54:17 +01:00

23 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* :::::::: */
/* ft_strdup_safe.c :+: :+: */
/* +:+ */
/* By: whaffman <whaffman@student.codam.nl> +#+ */
/* +#+ */
/* Created: 2025/02/20 18:01:27 by whaffman #+# #+# */
/* Updated: 2025/02/20 18:04:53 by whaffman ######## odam.nl */
/* */
/* ************************************************************************** */
#include "minishell.h"
char *ft_strdup_safe(t_minishell *minishell, const char *str)
{
char *new_str;
new_str = ft_strdup(str);
check_malloc(minishell, new_str);
return (new_str);
}