From a38c0eb7d2c8c014ccb38f5dff327a69ebfb4d55 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 466fcb38fe..d832640edd 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);