void *malloc(size_t size)
malloc returns a pointer to space for an object of size size, or NULL if the request cannot be satisfied. The space is uninitialized.
malloc() allocates size bytes and returns a pointer to the allocated
memory. The memory is not cleared. If size is 0, then malloc()
returns either NULL, or a unique pointer value that can later be suc‐
cessfully passed to free().
the value returned is a pointer to the allo‐
cated memory, which is suitably aligned for any kind of variable, or
NULL if the request fails.
malloc returns a void pointer to the allocated space, or NULL if there is insufficient memory available. To return a pointer to a type other than void, use a type cast on the return value. The storage space pointed to by the return value is guaranteed to be suitably aligned for storage of any type of object. If size is 0, malloc allocates a zero-length item in the heap and returns a valid pointer to that item. Always check the return from malloc, even if the amount of memory requested is small.