Deallocation of arrays passed as c_ptr

Then it violates the constraint on c_loc:

If it is an array, it shall be contiguous and have nonzero size

You can deallocate either p or q, but at that point neither have a defined association status, and it is invalid to reference either one.

1 Like