From 0f00aecb75cc686352aaa10b5b68957f278be84e Mon Sep 17 00:00:00 2001 From: Slava Semushin Date: Sat, 23 May 2009 00:43:29 +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 files changed, 4 insertions(+), 0 deletions(-) diff --git a/source3/torture/vfstest.c b/source3/torture/vfstest.c index bb4dc35..1df900f 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 (*filename != '-') { + fclose(file); + } } void exit_server(const char *reason) -- 1.6.3.1