Use delete[] instead of free on an array created with new[].