libft/sources/error_srcs/ft_error_exit.c
void	ft_error_exit(char *user_msg, void *memory, void (*del)(void *))
{
	if (memory != NULL)
	{
		if (del)
			del(memory);
		else
		{
			ft_printf("{RED}{B}MEMORY ERROR{EOC}: Memory (%p) not cleaned.",\
			memory);
			ft_printf("Clearing function not found!\n");
		}
	}
	if (errno != 0)
		perror("SYSTEM ERROR MESSAGE: ");
	if (user_msg)
		ft_printf("{RED}{B}USER ERROR MESSAGE{EOC}: %s\n", user_msg);
	exit(-1);
}
/*
**	This function writes and error output and exits a program
**	after clearing the memory.
**
**	Parametres:
**	user_msg:	string containing a message from user to be output on stdout
**	memory:		pointer to a mememory to be cleared
**	del:		pointer to a function that clears given memory
*/
This function writes and error output and exits a program
after clearing the memory.

string containing a message from user to be output on stdout
memory:         pointer to a mememory to be cleared
del:            pointer to a function that clears given memory
This function writes and error output and exits a program after clearing the memory . string containing a message from user to be output on stdout memory : pointer to a mememory to be cleared del : pointer to a function that clears given memory
void	ft_error_exit(char *user_msg, void *memory, void (*del)(void *))
{
	if (memory != NULL)
	{
		if (del)
			del(memory);
		else
		{
			ft_printf("{RED}{B}MEMORY ERROR{EOC}: Memory (%p) not cleaned.",\
			memory);
			ft_printf("Clearing function not found!\n");
		}
	}
	if (errno != 0)
		perror("SYSTEM ERROR MESSAGE: ");
	if (user_msg)
		ft_printf("{RED}{B}USER ERROR MESSAGE{EOC}: %s\n", user_msg);
	exit(-1);
}
void ft_error_exit ( char * user_msg , void * memory , void ( * del ) ( void * ) ) { if ( memory != NULL ) { if ( del ) del ( memory ) ; else { ft_printf ( " " , memory ) ; ft_printf ( " \n " ) ; } } if ( errno != 0 ) perror ( " " ) ; if ( user_msg ) ft_printf ( " \n " , user_msg ) ; exit ( -1 ) ; }
This function writes and error output and exits a program
after clearing the memory.
This function writes and error output and exits a program after clearing the memory .