summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSlava Semushin <php-coder@altlinux.ru>2009-05-25 23:59:05 +0700
committerVolker Lendecke <vl@samba.org>2009-06-05 10:17:09 +0200
commitecd1fe2456acb1c700d7bf91eb0ec76103e7db93 (patch)
treeaeb94a3125c5dec770c11fb43dca51bd526e06dd
parent53f007193fab325c2b27567db01679f87baf4f9a (diff)
downloadsamba-ecd1fe2456acb1c700d7bf91eb0ec76103e7db93.tar.gz
samba-ecd1fe2456acb1c700d7bf91eb0ec76103e7db93.tar.bz2
samba-ecd1fe2456acb1c700d7bf91eb0ec76103e7db93.zip
source3/torture/vfstest.c(process_file): fixed file descriptor leak.
Found by cppcheck: [./source3/torture/vfstest.c:400]: (error) Resource leak: file
-rw-r--r--source3/torture/vfstest.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source3/torture/vfstest.c b/source3/torture/vfstest.c
index de68a0b3c5..2a191c2800 100644
--- a/source3/torture/vfstest.c
+++ b/source3/torture/vfstest.c
@@ -397,6 +397,10 @@ static void process_file(struct vfs_state *pvfs, char *filename) {
while (fgets(command, 3 * PATH_MAX, file) != NULL) {
process_cmd(pvfs, command);
}
+
+ if (file != stdin) {
+ fclose(file);
+ }
}
void exit_server(const char *reason)