Add some missing frees. Thanks to John Darrington for reporting
authorBen Pfaff <blp@gnu.org>
Sat, 25 Mar 2006 02:16:58 +0000 (02:16 +0000)
committerBen Pfaff <blp@gnu.org>
Sat, 25 Mar 2006 02:16:58 +0000 (02:16 +0000)
these.

src/data/ChangeLog
src/data/any-reader.c
src/data/any-writer.c

index f3a7c12bfa9ca299c3e8e5b899b78fbfb617a7f6..f13016a64b7a992f293aac1bf676a5accd587401 100644 (file)
@@ -1,3 +1,12 @@
+Fri Mar 24 18:15:41 2006  Ben Pfaff  <blp@gnu.org>
+
+       Add some missing frees.  Thanks to John Darrington for reporting
+       these.
+
+       * any-writer.c (any_writer_close): Free writer.
+
+       * any-reader.c (any_reader_close): Free reader.
+
 Mon Mar 20 16:33:53 2006  Ben Pfaff  <blp@gnu.org>
 
        * por-file-reader.c: (error) Mark as NO_RETURN.
index 64f881e3e124e2d382ffe0fed927b1bb3c291d88..df37c8ea470afb8f8be68fbf028d50854cc96f2f 100644 (file)
@@ -204,4 +204,6 @@ any_reader_close (struct any_reader *reader)
     default:
       abort ();
     }
+
+  free (reader);
 }
index c5d741a28a800d92efeed76d151492ebbfc7d321..9ee8af917e03cbdfd03f49642409a725addd5ae0 100644 (file)
@@ -189,21 +189,29 @@ any_writer_error (const struct any_writer *writer)
 bool
 any_writer_close (struct any_writer *writer) 
 {
+  bool ok;
+  
   if (writer == NULL)
     return true;
 
   switch (writer->type) 
     {
     case SYSTEM_FILE:
-      return sfm_close_writer (writer->private);
+      ok = sfm_close_writer (writer->private);
+      break;
 
     case PORTABLE_FILE:
-      return pfm_close_writer (writer->private);
+      ok = pfm_close_writer (writer->private);
+      break;
 
     case SCRATCH_FILE:
-      return scratch_writer_close (writer->private);
-
+      ok = scratch_writer_close (writer->private);
+      break;
+      
     default:
       abort ();
     }
+
+  free (writer);
+  return ok;
 }