How to avoid memory leak : Question on memory leak. Probably a basic one.

C++ Pseudo code:

    map map_a;
    for ( 1 to 10 ) {
      element = 5;
      vector<int> *ptr = map_a[element];
      if (!ptr) {
        ptr = new vector<int>;
        map[element] = ptr;
      }
      ptr->push_back(i);
    }

How to free up the memory we are allocation using new?