krealloc — reallocate memory. The contents will remain unchanged.
object to reallocate memory for.
how many bytes of memory are required.
the type of memory to allocate.
The contents of the object pointed to are preserved up to the lesser of the new and old sizes. If p is NULL, krealloc behaves exactly like kmalloc. If size is 0 and p is not a NULL pointer, the object pointed to is freed.