title: Memory leak in boost::regex library
body: <p>I'm not big on the Boost library. I need it for a regular expression matching in my legacy C++/MFC project that is compiled in the VS 2008.</p>
  
  <p>Here's a short code snippet:</p>
  
  <pre><code>//Need Unicode support
  CString ss;
  boost::tregex r(L"&lt;(From )?([A-Za-z0-9_]+)&gt;(.*?)");
  boost::tmatch what;
  CString chat_input(L"&lt;Darker&gt; Hello");
  if(boost::regex_match(chat_input, what, r))     //Memory leak on this line
  {
      // extract $1 as a CString:
      ss = L"Match";//CString(what[1].first, what.length(1));
  }
  else
  {
      ss = L"No match";
  }
  </code></pre>
  
  <p>When I run that in a debug mode, I get the following in the output window:</p>
  
  <pre><code>Detected memory leaks!
  Dumping objects -&gt;
  {287} normal block at 0x00460068, 4096 bytes long.
   Data: &lt;                &gt; 00 00 00 00 CD CD CD CD CD CD CD CD CD CD CD CD 
  Object dump complete.
  </code></pre>
  
  <p>And if I comment out the <code>boost::regex_match</code> line, the leak goes away.</p>
  
  <p>What am I missing here?</p>
  
  <p>PS. The version of boost that I'm linking to is 1_55_0.</p>