e2fsprogs/resize
Lukas Czerner 47fee2ef6a e2fsprogs: introduce ext2fs_close_free() helper
Currently there are many uses of ext2fs_close() which might be wrong.
First of all ext2fs_close() does not set the ext2_filsys pointer to NULL
so the caller is responsible for clearing it, however there are some
cases there we do not do it.

Second of all very small number of users of ext2fs_close() actually
check the return value. If there is a problem in ext2fs_close() it will
not even free the ext2_filsys structure, but majority of users expect it
to do so.

To fix both problems this commit introduces a new helper
ext2fs_close_free() which will not only check for the return value and
free the ext2_filsys structure if the call to ext2fs_close2() failed,
but it will also set the ext2_filsys pointer to NULL.

Replace every use of ext2fs_close() in e2fsprogs tools with
ext2fs_close_free() - there is no real reason to keep using
ext2fs_close().

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
2014-07-05 21:06:48 -04:00
..
Makefile.in Add coverage testing using gcov 2014-02-23 00:17:09 -05:00
Makefile.pq Many files: 1997-11-14 05:23:04 +00:00
extent.c Fix spelling errors pointed out by translators 2011-10-08 13:32:00 -04:00
main.c e2fsprogs: introduce ext2fs_close_free() helper 2014-07-05 21:06:48 -04:00
online.c Add support for new compat feature "sparse_super2" 2014-01-30 13:58:18 -05:00
resize2fs.8.in resize2fs: add debugging support for resize2fs -M calcuations 2013-09-30 22:12:22 -04:00
resize2fs.c e2fsprogs: introduce ext2fs_close_free() helper 2014-07-05 21:06:48 -04:00
resize2fs.h Clean up sparse warnings 2013-12-16 18:56:36 -05:00
resource_track.c resize2fs: add resource tracking as a debug option 2013-01-03 09:03:53 -05:00
sim_progress.c Shorten compile commands run by the build system 2011-09-18 17:34:37 -04:00
test-resize resize2fs: check in test-resize script 2013-01-16 14:09:21 -05:00
test_extent.c test_extents: fix a possible memory leak 2014-01-05 22:58:16 -05:00
test_extent.in Many files: 1997-06-17 03:52:12 +00:00