From 268f34bbcc0f73bf0c7b7d65c013bfe833626bcd Mon Sep 17 00:00:00 2001 From: Andrei Belov Date: Mon, 23 Apr 2018 10:36:27 +0300 Subject: [PATCH] Fix memory leak in modsecurity::utils::expandEnv() Found by ASAN. --- src/utils/system.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/system.cc b/src/utils/system.cc index 466fcb38..d832640e 100644 --- a/src/utils/system.cc +++ b/src/utils/system.cc @@ -126,9 +126,9 @@ std::list 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);