Fix memory leak in modsecurity::utils::expandEnv()

Found by ASAN.
This commit is contained in:
Andrei Belov 2018-04-23 10:36:27 +03:00 committed by Felipe Zimmerle
parent f888f4e5e4
commit 268f34bbcc
No known key found for this signature in database
GPG Key ID: E6DFB08CE8B11277

View File

@ -126,9 +126,9 @@ std::list<std::string> expandEnv(const std::string& var, int flags) {
std::ifstream *iss = new std::ifstream(exp[0], std::ios::in);
if (iss->is_open()) {
iss->close();
delete iss;
vars.push_back(exp[0]);
}
delete iss;
}
}
wordfree(&p);