title: how to free memory when using TinyXML?
body: <p>I am looking over leak memory. I am working with Valgrind and i have some errors like:</p>
  
  <pre><code>Invalid read of size 1
  ==6643==    at 0x4026CC4: strlen (mc_replace_strmem.c:282)
  ==6643==    by 0x40D42DA: std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;::basic_string(char const*, std::allocator&lt;char&gt; const&amp;)
  ==6643==    by 0x804B8AB: main
  ==6643==  Address 0x441f895 is 13 bytes inside a block of size 45 free'd
  ==6643==    at 0x4025504: operator delete(void*) (vg_replace_malloc.c:387)
  ==6643==    by 0x40D1ACC: std::string::_Rep::_M_destroy(std::allocator&lt;char&gt; const&amp;) 
  ==6643==    by 0x40D1B8B: std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;::~basic_string() 
  ==6643==    by 0x804CE6A: TiXmlNode::~TiXmlNode() 
  ==6643==    by 0x80B6241: TiXmlText::~TiXmlText() 
  ==6643==    by 0x804D0B0: TiXmlNode::Clear()
  ==6643==    by 0x804E13E: TiXmlElement::ClearThis() 
  </code></pre>
  
  <p>The code is:</p>
  
  <pre><code>TiXmlHandle handle(&amp;doc);
  
  
  TiXmlElement* section,*pRoot,*pParam,*section1,*section2;
  
  pRoot=doc.FirstChildElement("xml");
  
  
   pParam=pRoot-&gt;FirstChildElement("Data");
  
  while (pParam)
  {
  
  section = pParam-&gt;FirstChildElement("Name");
      if (section)
     {
  
      const char* str= section-&gt;GetText();
  
      long long int v;
      sscanf(str, "%lld", &amp;v);
  
  
      }
  </code></pre>
  
  <p>Appreciate. THX</p>