(C++) list.error method and deleting memory using pointer
===

    typedef struct  value 
    {
    	char* contents;
    	int size;
    }Value;
    
    hash_map<Key,list<Value>,hash<Key>,eqKey> dspace;
    list<Value> vallist;

.

what i am doing every time i am creating a  Value variable and adding to this list . 

I have a pointer Value * ptr and i am using this pointer to point a member of the list and finally I am erasing the member from the list . 

Now i can access the value using pointer but not using the list iterator. 

I have two Question 
1. does erase remove the element from the but the allocated memory remain unchanged or the memory is also being freed .
2. It is possible to free the memory using this ptr . or if i set the ptr to some other member of the list then the memory occupied by the previous member will be freed or not  .
