From 4262162ac207f526acdcffa5ed22e34c3674c28a Mon Sep 17 00:00:00 2001 From: Manish Katiyar Date: Sat, 23 Aug 2008 21:41:25 +0530 Subject: [PATCH] debugfs: Close the file handle and return in case of errors Close the filehandle and return in case if we are unable to expand the directory during write. Signed-off-by: "Manish Katiyar" Signed-off-by: Theodore Ts'o --- debugfs/debugfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c index 7039340..ab40de8 100644 --- a/debugfs/debugfs.c +++ b/debugfs/debugfs.c @@ -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, -- 1.8.3.1