If ptr is the NULL pointer, the behavior of the realloc function is identical to the malloc function. The contents of the area are unchanged up to the lesser of the old and new sizes. The ANSI C Standard states that, "If the new size is larger than the old size, the value of the newly allocated portion of memory is indeterminate." For compatibility with old implementations, Compaq C initializes the newly allocated memory to 0. For efficiency, the previous actual allocation could have been larger than the requested size. If it was allocated with malloc, the value of the portion of memory between the previous requested allocation and the actual allocation is indeterminate. If it was allocated with calloc, that same memory was initialized to 0. If your application relies on realloc initializing memory to 0, then use calloc instead of malloc to perform the initial allocation. The maximum amount of memory allocated at once is limited to 0xFFFFD000. See also free, cfree, calloc, and malloc.