Hello!
I am trying to make sure that I clean up and free all the resources that I allocate in my code.
In the following code, I am assuming that if new throws bad_alloc, than the value of array1 or array2 is unmodified,
that is, they remain NULL.
In this case, if allocation of array1 succeeds...