Using delete[] for pointer that created with new[]