title: may be boost ssl handshake function have some memory leak
body: <p>I got memory leak problem in my code.<br/>
  when i call socket.handshake() functions, <br/>
  and then exit main thread, i got memory leak. <br/>
  <br/>
  but, remove 'socket.handshake' and then <br/>
  run &amp; exit main thread, memory leak probleam is disappeared. <br/></p>
  
  <p><br/>
  <strong>1. sample code : memory leak</strong><br/>
  <br/></p>
  
  <pre><code>#include &lt;boost/asio.hpp&gt;
  #include &lt;boost/asio/ssl.hpp&gt;
  #include &lt;boost/thread.hpp&gt;
  
  using namespace boost;
  
  void ThSslEchoClient()
  {
      try
      {
          asio::io_service ios;
          asio::ssl::context context(boost::asio::ssl::context::sslv23);
  
          context.set_options(
              asio::ssl::context::default_workarounds  
              | asio::ssl::context::no_sslv2  
              | asio::ssl::context::single_dh_use);
  
          asio::ssl::stream&lt;boost::asio::ip::tcp::socket&gt; socket(ios, context);
          boost::system::error_code ec;
          boost::asio::ip::tcp::endpoint host(boost::asio::ip::address::from_string("127.0.0.1"), 13);
  
          socket.lowest_layer().connect(host, ec);
          // REMOVE THE FOLLOWING LINE FOR COMPARISON
          socket.handshake(asio::ssl::stream_base::client, ec);
  
          if (ec)
              throw boost::system::system_error(ec);
      }
      catch (std::exception&amp; _e)
      {
          std::cerr &lt;&lt; _e.what() &lt;&lt; std::endl;
      }
  }
  
  void TestBoostAsioSslEchoClient()
  {
      boost::thread_group tg;
  
      tg.create_thread(ThSslEchoClient);
      tg.join_all();
  }
  </code></pre>
  
  <p><strong>2. sample code : no memory leak.</strong><br/>
  (just remove 'socket.handshake')</p>
  
  <pre><code>        // REMOVE THE FOLLOWING LINE FOR COMPARISON
          //socket.handshake(asio::ssl::stream_base::client, ec);
  </code></pre>
  
  <p>I don't know where is wrong.
  please help me. </p>