e2fsck: add error-checking when unlink tdb file for dir_info

Fixes-Coverity-Bug: 1308365
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This commit is contained in:
Theodore Ts'o 2018-06-24 14:00:14 -04:00
parent c5fbc536b5
commit 0abe5745b6

View File

@ -326,7 +326,9 @@ void e2fsck_free_dir_info(e2fsck_t ctx)
if (ctx->dir_info->tdb)
tdb_close(ctx->dir_info->tdb);
if (ctx->dir_info->tdb_fn) {
unlink(ctx->dir_info->tdb_fn);
if (unlink(ctx->dir_info->tdb_fn) < 0)
com_err("e2fsck_free_dir_info", errno,
_("while freeing dir_info tdb file"));
free(ctx->dir_info->tdb_fn);
}
#endif