- RtlReAllocateHeap shouldn't allocate memory if ptr == NULL.
[reactos.git] / reactos / lib / crtdll / stdlib / malloc.c
index 496affc..e72b7cc 100644 (file)
@@ -31,5 +31,7 @@ void* calloc(size_t _nmemb, size_t _size)
  */
 void* realloc(void* _ptr, size_t _size)
 {
  */
 void* realloc(void* _ptr, size_t _size)
 {
+   if (!_ptr)
+      return(HeapAlloc(GetProcessHeap(),0,_size));
    return(HeapReAlloc(GetProcessHeap(),0,_ptr,_size));
 }
    return(HeapReAlloc(GetProcessHeap(),0,_ptr,_size));
 }