2007-03-21 Theodore Tso <tytso@mit.edu>
+ * htree.c (htree_dump_int_block): Fix memory leak on error paths.
+
* dump.c (rdump_dirent), htree.c (htree_dump_leaf_node),
ls.c (list_dir_proc): Add an extra byte to EXT2_NAME_LEN
to avoid the possibility of an array overrun if the
if (errcode) {
com_err("htree_dump_int_block", errcode,
"while mapping logical block %u\n", blk);
- return;
+ goto errout;
}
errcode = io_channel_read_blk(current_fs->io, pblk, 1, buf);
if (errcode) {
com_err("htree_dump_int_block", errcode,
"while reading block %u\n", blk);
- return;
+ goto errout;
}
htree_dump_int_node(fs, ino, inode, rootnode,
(struct ext2_dx_entry *) (buf+8),
cbuf, level);
+errout:
free(cbuf);
}