]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
debugfs: add matching fclose
authorPeng Tao <bergwolf@gmail.com>
Mon, 28 Sep 2009 10:51:53 +0000 (18:51 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 4 Oct 2009 02:30:37 +0000 (22:30 -0400)
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 <bergwolf@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
debugfs/debugfs.c

index a72d800dafa98b95ec90fbe4c25ab89f61428abb..be95e2093502c33b7b2dd219bd7f700cc825948f 100644 (file)
@@ -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;
 }