From ecd1fe2456acb1c700d7bf91eb0ec76103e7db93 Mon Sep 17 00:00:00 2001 From: Slava Semushin Date: Mon, 25 May 2009 23:59:05 +0700 Subject: [PATCH] source3/torture/vfstest.c(process_file): fixed file descriptor leak. Found by cppcheck: [./source3/torture/vfstest.c:400]: (error) Resource leak: file --- source3/torture/vfstest.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source3/torture/vfstest.c b/source3/torture/vfstest.c index de68a0b3c52..2a191c2800a 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) -- 2.11.4.GIT