* redistributed under the terms of the GNU Public License.
*/
+#include "config.h"
#include <time.h>
#ifdef HAVE_ERRNO_H
#include <errno.h>
retval = ext2fs_block_iterate(fs, EXT2_BAD_INO, 0, 0,
check_bb_inode_blocks, 0);
if (retval) {
- com_err("ext2fs_block_iterate", retval,
+ com_err("ext2fs_block_iterate", retval, "%s",
_("while sanity checking the bad blocks inode"));
goto fatal;
}
if (!replace_bad_blocks) {
retval = ext2fs_read_bb_inode(fs, &bb_list);
if (retval) {
- com_err("ext2fs_read_bb_inode", retval,
+ com_err("ext2fs_read_bb_inode", retval, "%s",
_("while reading the bad blocks inode"));
goto fatal;
}
else
pclose(f);
if (retval) {
- com_err("ext2fs_read_bb_FILE", retval,
+ com_err("ext2fs_read_bb_FILE", retval, "%s",
_("while reading in list of bad blocks from file"));
goto fatal;
}
printf("%s: Updating bad block inode.\n", ctx->device_name);
retval = ext2fs_update_bb_inode(fs, bb_list);
if (retval) {
- com_err("ext2fs_update_bb_inode", retval,
+ com_err("ext2fs_update_bb_inode", retval, "%s",
_("while updating bad block inode"));
goto fatal;
}
fatal:
ctx->flags |= E2F_FLAG_ABORT;
+ if (bb_list)
+ ext2fs_badblocks_list_free(bb_list);
return;
}