diff options
Diffstat (limited to 'c12/ex00/ft_create_elem.c')
| -rw-r--r-- | c12/ex00/ft_create_elem.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/c12/ex00/ft_create_elem.c b/c12/ex00/ft_create_elem.c index 8b6996a..092833b 100644 --- a/c12/ex00/ft_create_elem.c +++ b/c12/ex00/ft_create_elem.c @@ -6,7 +6,7 @@ /* By: cacharle <charles.cabergs@gmail.com> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/07/09 17:19:22 by cacharle #+# #+# */ -/* Updated: 2019/07/09 17:19:24 by cacharle ### ########.fr */ +/* Updated: 2019/07/17 18:34:23 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -17,7 +17,8 @@ t_list *ft_create_elem(void *data) { t_list *list; - list = (t_list*)malloc(sizeof(t_list)); + if((list = (t_list*)malloc(sizeof(t_list))) == NULL) + return (NULL); list->data = data; list->next = NULL; return (list); |
