From 7efb97e033bdad9dedfa08bc2ce0058a55598171 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 4 Oct 2015 20:22:51 -0400 Subject: [PATCH] avoid leaking a file pointer when out keyword is given multiple times --- src/info.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/info.cpp b/src/info.cpp index bc7840ac43..c34eb401cd 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -104,6 +104,7 @@ void Info::command(int narg, char **arg) ++idx; } else if ((idx+1 < narg) && (strncmp(arg[idx],"out",3) == 0) && (strncmp(arg[idx+1],"screen",3) == 0)) { + if ((out != screen) && (out != logfile)) fclose(out); out = screen; idx += 2; } else if ((idx+1 < narg) && (strncmp(arg[idx],"out",3) == 0)