In ext2fs_alloc_generic_bmap() error path, when new bitmap allocation
fails ext2fs_generic_bitmap should be freed, however in current state it
first frees ext2fs_generic_bitmap and then
ext2fs_generic_bitmap->description which is wrong. This commit fix the
free ordering.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
retval = bitmap->bitmap_ops->new_bmap(fs, bitmap);
if (retval) {
- ext2fs_free_mem(&bitmap);
ext2fs_free_mem(&bitmap->description);
+ ext2fs_free_mem(&bitmap);
return retval;
}