Fix the memheap_realloc issue