title: Memory leak in Ada.Strings.Unbounded ?
body: <p>I have a curious memory leak, it seems that the library function to_unbounded_string is leaking!</p>
  
  <p>Code snippets: </p>
  
  <pre><code>procedure Parse (Str    : in     String;
  </code></pre>
  
  <p>... do stuff... </p>
  
  <pre><code>declare
     New_Element : constant Ada.Strings.Unbounded.Unbounded_String :=
       Ada.Strings.Unbounded.To_Unbounded_String (Str); -- this leaks
  begin
  </code></pre>
  
  <p>valgrind output: </p>
  
  <pre><code>==6009== 10,276 bytes in 1 blocks are possibly lost in loss record 153 of 153
  ==6009==    at 0x4025BD3: malloc (vg_replace_malloc.c:236)
  ==6009==    by 0x42703B8: __gnat_malloc (in /usr/lib/libgnat-4.4.so.1)
  ==6009==    by 0x4269480: system__secondary_stack__ss_allocate (in /usr/lib/libgnat-4.4.so.1)
  ==6009==    by 0x414929B: ada__strings__unbounded__to_unbounded_string (in /usr/lib/libgnat-4.4.so.1)
  ==6009==    by 0x80F8AD4: syntax__parser__dash_parser__parseXn (token_parser_g.adb:35)
  </code></pre>
  
  <p>Where token_parser_g.adb:35 is listed above as the "-- this leaks" line.</p>
  
  <p>Other info: Gnatmake version 4.4.5. gcc version 4.4 valgrind version valgrind-3.6.0.SVN-Debian, valgrind options -v --leak-check=full --read-var-info=yes --show-reachable=no </p>
  
  <p>Any help or insights appreciated,</p>
  
  <p>NWS.</p>