-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_memalloc.c
22 lines (19 loc) · 1.03 KB
/
ft_memalloc.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memalloc.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: bpezeshk <bpezeshk@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/01/17 14:09:33 by bpezeshk #+# #+# */
/* Updated: 2017/01/19 13:05:46 by bpezeshk ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memalloc(size_t size)
{
void *mem;
if ((mem = malloc(size)) == NULL)
return (ft_memfree(mem));
return (ft_memset(mem, 0, size));
}