Corrected our realloc logic to prevent writing over the existing data