From: Ben Pfaff Date: Sat, 25 Mar 2006 02:16:58 +0000 (+0000) Subject: Add some missing frees. Thanks to John Darrington for reporting X-Git-Tag: v0.6.0~1033 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac6051350fba373c6f72ad44deded2b5b0e31ca0;p=pspp-builds.git Add some missing frees. Thanks to John Darrington for reporting these. --- diff --git a/src/data/ChangeLog b/src/data/ChangeLog index f3a7c12b..f13016a6 100644 --- a/src/data/ChangeLog +++ b/src/data/ChangeLog @@ -1,3 +1,12 @@ +Fri Mar 24 18:15:41 2006 Ben Pfaff + + 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 * por-file-reader.c: (error) Mark as NO_RETURN. diff --git a/src/data/any-reader.c b/src/data/any-reader.c index 64f881e3..df37c8ea 100644 --- a/src/data/any-reader.c +++ b/src/data/any-reader.c @@ -204,4 +204,6 @@ any_reader_close (struct any_reader *reader) default: abort (); } + + free (reader); } diff --git a/src/data/any-writer.c b/src/data/any-writer.c index c5d741a2..9ee8af91 100644 --- a/src/data/any-writer.c +++ b/src/data/any-writer.c @@ -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; }