From: Peng Tao Date: Mon, 28 Sep 2009 10:51:53 +0000 (+0800) Subject: debugfs: add matching fclose X-Git-Tag: v1.41.10~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d7ef236b752c1da7868f009018075fddc01d810;p=thirdparty%2Fe2fsprogs.git 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 --- diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c index a72d800da..be95e2093 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; }