title: Why is my heap is corrupted?
body: <p>I'm getting an error - heap corruption, can't figure out why.  </p>
  
  <p>My base :</p>
  
  <p>h:  </p>
  
  <pre><code>class Base
  {
  public :
      Base(char* baseName, char* cityName);
      virtual ~Base();
  
      list&lt;Vehicle*&gt;::const_iterator GetEndList();
      void PrintAllVehicles(ofstream &amp;ResultFile) const;
      char* GetBaseName() const;
      char* GetLocation() const;
      void InsertNewVehicleToBase(Vehicle* newVehicle);
      list&lt;Vehicle*&gt;::const_iterator FindVehicle(char* id);
      void RemoveVehicle (list&lt;Vehicle*&gt;::const_iterator beg);
  
  
  
   private:
      char* m_name;
      char* m_location;
      list&lt;Vehicle*&gt; m_baseVehicles;
  
  };  
  </code></pre>
  
  <p>cpp :  </p>
  
  <pre><code>Base::Base(char* baseName, char* cityName)
  {
      m_name = new char [strlen(baseName)+1];
      strcpy(m_name, baseName);
      m_location = new char [strlen(cityName)+1];
      strcpy(m_location, cityName);
  }
  
  Base::~Base()
  {
      delete [] m_name;
      delete [] m_location;
      //m_baseVehicles.clear();
  }
  </code></pre>
  
  <p>army destructor :  </p>
  
  <pre><code>Army::~Army()
  {
      list&lt;Base*&gt;::iterator baseIter = m_basesList.begin();
      for (baseIter ; baseIter != m_basesList.end() ; ++baseIter)
          delete (*baseIter);
      m_basesList.clear();
   }  
  </code></pre>
  
  <p>What am I doing wrong? </p>