* io/transfer.c (finalize_transfer): Free internal streams.
	* io/unix.c (mem_close): Free stream object.
From-SVN: r88709
+2004-10-07  Paul Brook  <paul@codesourcery.com>
+
+       * io/transfer.c (finalize_transfer): Free internal streams.
+       * io/unix.c (mem_close): Free stream object.
+
 2004-10-07  Paul Brook  <paul@codesourcery.com>
 
        * intrinsics/string_intrinsics.c (string_verify): Fix off by one
 
 
 
 /* Finalize the current data transfer.  For a nonadvancing transfer,
-   this means advancing to the next record.  */
+   this means advancing to the next record.  For internal units close the
+   steam associated with the unit.  */
 
 static void
 finalize_transfer (void)
     }
 
   sfree (current_unit->s);
+
+  if (is_internal_unit ())
+    sclose (current_unit->s);
 }
 
 
 
 static try
 mem_close (unix_stream * s)
 {
+  free_mem (s);
 
   return SUCCESS;
 }