summaryrefslogtreecommitdiff
path: root/lib/ext2fs/getsize.c
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@redhat.com>2011-09-16 15:49:28 -0500
committerTheodore Ts'o <tytso@mit.edu>2011-09-16 18:43:05 -0400
commit624e8ebe3058bad9af6e719b7f9e7afab7d3fe30 (patch)
tree692092f8658aed20d0899e1df0bb362081320454 /lib/ext2fs/getsize.c
parentf85a9ae6397ff074193322a12ed721dbf5751e41 (diff)
downloade2fsprogs-624e8ebe3058bad9af6e719b7f9e7afab7d3fe30.tar.gz
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>
Diffstat (limited to 'lib/ext2fs/getsize.c')
0 files changed, 0 insertions, 0 deletions