Fix wrong delete[] possible memory corruption.