title: STL vector containing vector causing segfault
body: <p>The following code causes a segfault when I try to issue my <code>push_back</code> call.  What am I doing wrong?</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  #include &lt;string&gt;
  using namespace std;
  
  int main() {
      std::string * foo = new std::string("hello world");
      cout &lt;&lt; *foo &lt;&lt; endl;
  
      std::vector&lt;std::vector&lt;std::string *&gt; &gt; my_vecs;
      my_vecs[0].push_back(foo); // segfaults
      cout &lt;&lt; "trying to print my_vecs size of " &lt;&lt; my_vecs.size() &lt;&lt; " but we never reach that point due to segfault " &lt;&lt; endl;
      return 0;
  }
  </code></pre>
  
  <p>I'm pretty sure I'm violating one of the contracts for using <code>vector</code>, as the problem is surely not with the STL implementation.</p>