realloc is used to reallocate the memory dynamically.
realloc
Suppose I have allocated 7 bytes using the malloc function and now I want to extend i
malloc
FreeBSD and Mac OS X have the reallocf() function that will free the passed pointer when the requested memory cannot be allocated (see man realloc).