title: Valgrind shows memory leak in std::make_unique
body: <p>I'm using Valgrind to check for memory leaks.
  Unfortunately I get a <code>Leak_DefinitelyLost</code> warning.</p>
  
  <p>Attached is a simplified version of my code that reproduces the error:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  #include &lt;memory&gt;
  #include &lt;unordered_map&gt;
  
  using namespace std;
  
  class Base{
  public:
      explicit Base(double a){
          a_ = a;
      }
      virtual void fun() = 0;
  
      protected:
          double a_;
  };
  
  
  class Derived_A : public Base{
  
      public:
          Derived_A(double a, vector&lt;double&gt; b, vector&lt;double&gt; c): Base(a), b_{b}, c_{c}{
          }
          void fun() override{
              cout &lt;&lt; "Derived_A " &lt;&lt; a_ &lt;&lt; endl;
          }
  
      private:
          vector&lt;double&gt; b_;
          vector&lt;double&gt; c_;
  };
  
  
  class Derived_B : public Base{
  
      public:
          Derived_B(double a, double b, double c): Base(a), b_{b}, c_{c}{
          }
  
          void fun() override{
              cout &lt;&lt; "Derived_B " &lt;&lt; a_ &lt;&lt; endl;
          }
  
      private:
          double b_;
          double c_;
  };
  
  int main() {
  
      unordered_map&lt;string, unique_ptr&lt;Base&gt; &gt; m;
  
      for(int i=0; i&lt;10; ++i){
          unique_ptr&lt;Base&gt; o;
          if(i%2 == 0){
              vector&lt;double&gt; b{1., 2., 3.};
              vector&lt;double&gt; c{4., 5., 6.};
              o = make_unique&lt;Derived_A&gt;(i, move(b), move(c));
              m[to_string(i)] = move(o);
          }else{
              double b = 1.;
              double c = 2.;
              o = make_unique&lt;Derived_B&gt;(i, b, c);
              m[to_string(i)] = move(o);
          }
      }
  
      for(const auto &amp;any:m){
          any.second-&gt;fun();
      }
  
      return 0;
  }
  </code></pre>
  
  <p>The lost happens during the <code>make_unique</code> call:</p>
  
  <pre><code>Leak_DefinitelyLost
  vg_replace_malloc.c
  240 bytes in 10 blocks are definitely lost in loss record 1 of 1
      operator new(unsigned long)
      __gnu_cxx::new_allocator&lt;double&gt;::allocate(unsigned long, void const*)
      std::allocator_traits&lt;std::allocator&gt;::allocate(std::allocator&lt;double&gt;&amp;, unsigned long)
      std::_Vector_base&lt;double, std::allocator&gt;::_M_allocate(unsigned long)
      std::_Vector_base&lt;double, std::allocator&gt;::_M_create_storage(unsigned long)
      std::_Vector_base&lt;double, std::allocator&gt;::_Vector_base(unsigned long, std::allocator&lt;double&gt; const&amp;)
      std::vector&lt;double, std::allocator&gt;::vector(std::vector&lt;double, std::allocator&gt; const&amp;)
      Derived_A::Derived_A(double, std::vector&lt;double, std::allocator&gt;, std::vector&lt;double, std::allocator&gt;)
      std::_MakeUniq&lt;Derived_A&gt;::__single_object std::make_unique&lt;Derived_A, int&amp;, std::vector, std::vector&gt;(int&amp;, std::vector&lt;double, std::allocator&gt;&amp;&amp;, std::vector&lt;double, std::allocator&gt;&amp;&amp;)
      main
  </code></pre>
  
  <p>I'm not sure what I'm doing wrong. Can someone please clarify where the error occurs?</p>
  
  <p>(I'm calling Valgrind from CLion 2018.1.5, Valgrind 3.13.0.)</p>