Skip to content

Commit 0dce460

Browse files
committed
Fixed potential memory leak when there is an intervention and log or url is set.
1 parent dab9bb6 commit 0dce460

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/benchmark/benchmark.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ int main(int argc, char *argv[]) {
7373
modsecurity::ModSecurity *modsec;
7474
modsecurity::RulesSet *rules;
7575
modsecurity::ModSecurityIntervention it;
76-
modsecurity::intervention::reset(&it);
76+
modsecurity::intervention::clean(&it);
7777
modsec = new modsecurity::ModSecurity();
7878
modsec->setConnectorInformation("ModSecurity-benchmark v0.0.1-alpha" \
7979
" (ModSecurity benchmark utility)");
@@ -167,6 +167,8 @@ int main(int argc, char *argv[]) {
167167
next_request:
168168
modsecTransaction->processLogging();
169169
delete modsecTransaction;
170+
modsecurity::intervention::free(&it);
171+
modsecurity::intervention::clean(&it);
170172
}
171173

172174
delete rules;

0 commit comments

Comments
 (0)