Skip to content

Commit 268f34b

Browse files
defanatorFelipe Zimmerle
authored andcommitted
Fix memory leak in modsecurity::utils::expandEnv()
Found by ASAN.
1 parent f888f4e commit 268f34b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils/system.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ std::list<std::string> expandEnv(const std::string& var, int flags) {
126126
std::ifstream *iss = new std::ifstream(exp[0], std::ios::in);
127127
if (iss->is_open()) {
128128
iss->close();
129-
delete iss;
130129
vars.push_back(exp[0]);
131130
}
131+
delete iss;
132132
}
133133
}
134134
wordfree(&p);

0 commit comments

Comments
 (0)