From 5904fc2d3de8607dbdff5b4344f1cce9fe4339c5 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 16 Dec 2013 11:13:41 +0100 Subject: [PATCH] one more fix needed to avoid leaking file descriptors --- src/input.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/input.cpp b/src/input.cpp index d680117706..d0ae8c7c05 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -242,7 +242,8 @@ void Input::file(const char *filename) if (me == 0) { if (nfile > 1) error->one(FLERR,"Invalid use of library file() function"); - + + if (infile && infile != stdin) fclose(infile); infile = fopen(filename,"r"); if (infile == NULL) { char str[128];