From 074a96c9ffc85763da833bccadefc9978152482c Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Mon, 9 Jul 2012 18:06:08 +0200 Subject: Close files opened with popen() with pclose() instead of fclose() --- src/configparser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/configparser.cpp b/src/configparser.cpp index a8e36f6e0..b6e3f7187 100644 --- a/src/configparser.cpp +++ b/src/configparser.cpp @@ -307,7 +307,7 @@ void ParseStack::DoReadFile(const std::string& key, const std::string& name, int if (exec && (flags & FLAG_NO_EXEC)) throw CoreException("Invalid tag in file included with noexec=\"yes\""); - FileWrapper file(exec ? popen(name.c_str(), "r") : fopen(name.c_str(), "r")); + FileWrapper file(exec ? popen(name.c_str(), "r") : fopen(name.c_str(), "r"), exec); if (!file) throw CoreException("Could not read \"" + name + "\" for \"" + key + "\" file"); @@ -364,7 +364,7 @@ bool ParseStack::ParseExec(const std::string& name, int flags) /* It's not already included, add it to the list of files we've loaded */ - FileWrapper file(popen(name.c_str(), "r")); + FileWrapper file(popen(name.c_str(), "r"), true); if (!file) throw CoreException("Could not open executable \"" + name + "\" for include"); -- cgit v1.2.3