Whamcloud - gitweb
debugfs: Close the file handle and return in case of errors
authorManish Katiyar <mkatiyar@gmail.com>
Sat, 23 Aug 2008 16:11:25 +0000 (21:41 +0530)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 24 Aug 2008 21:29:33 +0000 (17:29 -0400)
Close the filehandle and return in case if we are unable to expand the
directory during write.

Signed-off-by: "Manish Katiyar" <mkatiyar@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
debugfs/debugfs.c

index 7039340..ab40de8 100644 (file)
@@ -1366,6 +1366,7 @@ void do_write(int argc, char *argv[])
                retval = ext2fs_expand_dir(current_fs, cwd);
                if (retval) {
                        com_err(argv[0], retval, "while expanding directory");
+                       close(fd);
                        return;
                }
                retval = ext2fs_link(current_fs, cwd, argv[2], newfile,