I'm totally new to Ada, and I have to learn it for a course I'm having in school.

One of the exercises I've done asks for a procedure to swap pointers' adresses, then to change a pointer's address to another, and to free that previous address.

As you can see in the next example, I'm doing what is required, but I was curious to see what happened to that address when it's freed up, by holding a reference to it, and realizing it puts garbage in it, I'm guessing the flags from that address changed, and something tells the compiler than that memory address has been liberated, I'm just not sure nor can find something online that says that my assumption is correct or not.

```
procedure Main is
   type T_Pointer is access Integer;
   I, J, aux: T_Pointer;

   procedure FreeMemoryAddress is new Unchecked_Deallocation(integer, T_Pointer);

   procedure ChangePointerAddress(Origen: in out T_Pointer; destino: in T_Pointer);

   procedure ChangePointerAddress(Origen: in out T_Pointer; destino: in T_Pointer)
   is
   begin
      origen:=destino;
   end ChangePointerAddress;

   procedure SwapPointers (I, J: in out T_Pointer);

   procedure SwapPointers (I, J: in out T_Pointer)
   is
      aux: T_Pointer;
   begin
      aux := new Integer;
      Aux := I;
      I:=J;
      J:=Aux;

   end SwapPointers;

begin

   I:=new Integer;
   J:=new Integer;

   Put_Line("i's uninitialized value: " & integer'Image(I.all));

   Put_Line("i's address: " & System.Address_Image(I.all'Address));
   Put_Line("j's address: " & System.Address_Image(j.all'Address));

   SwapPointers(I, J);
   Put_Line("After swapping:");
   Put_Line("i's address: " & System.Address_Image(I.all'Address));
   Put_Line("j's address: " & System.Address_Image(j.all'Address));

   aux:=j;
   FreeMemoryAddress(j);
   Put_Line("aux's value: " & Integer'Image(aux.all)); --garbage
   Put_Line("aux's address: " & System.Address_Image(aux.all'Address));

end Main;

```