Whamcloud - gitweb
e2fsck: add error-checking when unlink tdb file for dir_info
authorTheodore Ts'o <tytso@mit.edu>
Sun, 24 Jun 2018 18:00:14 +0000 (14:00 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 24 Jun 2018 18:00:14 +0000 (14:00 -0400)
Fixes-Coverity-Bug: 1308365
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/dirinfo.c

index b29f7e9..cceadac 100644 (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