From 2d7ef236b752c1da7868f009018075fddc01d810 Mon Sep 17 00:00:00 2001 From: Peng Tao Date: Mon, 28 Sep 2009 18:51:53 +0800 Subject: [PATCH] debugfs: add matching fclose If the cmd_file is not stdin, we should close the file handle via fclose(). Thanks David Binderman to point this out. Addresses-Novell-Bugzilla: #524526 Signed-off-by: Peng Tao Signed-off-by: Theodore Ts'o --- debugfs/debugfs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c index a72d800..be95e20 100644 --- a/debugfs/debugfs.c +++ b/debugfs/debugfs.c @@ -2133,6 +2133,8 @@ static int source_file(const char *cmd_file, int sci_idx) exit_status++; } } + if (f != stdin) + fclose(f); return exit_status; } -- 1.8.3.1