e2fsprogs/lib
Eric Sandeen 624e8ebe30 e2fsprogs: Fix some error cleanup path bugs
In inode_open(), if the allocation of &io fails, we go to cleanup
and dereference io to test io->name, which is a bug.

Similarly in undo_open()  if allocation of &data fails, we
go to cleanup and dereference data to test data->real.

In the test_open() case we explicitly set retval to the only
possible error return from ext2fs_get_mem(), so remove that
for tidiness.

The other changes just make make earlier returns go through
the error goto for consistency.

In many cases we returned directly from the first error, but
"goto cleanup" etc for every subsequent error.  In some
cases this leads to "impossible" tests such as:

	if (ptr)
		ext2fs_free_mem(&ptr)

on paths where ptr cannot be null because we would have
returned directly earlier, and Coverity flags this.

This isn't really indicative of an error in most cases, but
I think it can be clearer to always exit through the error goto
if it's used later in the function.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-09-16 18:43:05 -04:00
..
blkid misc: clean up compiler warnings 2011-06-11 10:58:25 -04:00
e2p libe2p: reach unreachable code 2011-09-16 18:43:05 -04:00
et libcom_err: Fix install rule if installing with hard links 2011-06-04 11:24:18 -04:00
ext2fs e2fsprogs: Fix some error cleanup path bugs 2011-09-16 18:43:05 -04:00
quota libquota: indicate in the ELF library image that it requires libext2fs 2011-09-16 11:12:59 -04:00
ss libcom_err: Only output ^M when tty is in raw mode 2010-05-15 07:48:25 -04:00
uuid Add configure options --enable-symlink-build and --enable-symlink-install 2010-05-17 19:21:42 -04:00
Makefile.bsd-lib Add configure options --enable-symlink-build and --enable-symlink-install 2010-05-17 19:21:42 -04:00
Makefile.checker Add configure options --enable-symlink-build and --enable-symlink-install 2010-05-17 19:21:42 -04:00
Makefile.darwin-lib Add configure options --enable-symlink-build and --enable-symlink-install 2010-05-17 19:21:42 -04:00
Makefile.elf-lib Add configure options --enable-symlink-build and --enable-symlink-install 2010-05-17 19:21:42 -04:00
Makefile.library Add configure options --enable-symlink-build and --enable-symlink-install 2010-05-17 19:21:42 -04:00
Makefile.profile Add configure options --enable-symlink-build and --enable-symlink-install 2010-05-17 19:21:42 -04:00
Makefile.solaris-lib Add configure options --enable-symlink-build and --enable-symlink-install 2010-05-17 19:21:42 -04:00
fpopen.c Remove trailing whitespace for the entire source tree 2008-08-27 23:07:54 -04:00