24 lines
1.0 KiB
C
24 lines
1.0 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* :::::::: */
|
|
/* check_malloc.c :+: :+: */
|
|
/* +:+ */
|
|
/* By: whaffman <whaffman@student.codam.nl> +#+ */
|
|
/* +#+ */
|
|
/* Created: 2025/02/20 18:00:10 by whaffman #+# #+# */
|
|
/* Updated: 2025/02/20 18:01:08 by whaffman ######## odam.nl */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "minishell.h"
|
|
|
|
|
|
void check_malloc(void *ptr)
|
|
{
|
|
if (ptr == NULL)
|
|
{
|
|
error_msg("malloc", "can't allocate memory");
|
|
exit(1);
|
|
}
|
|
}
|