Skip to content

Commit 5a32b38

Browse files
author
Felipe Zimmerle
committed
chunks example: Sets the freed variables to NULL
1 parent 6d77c76 commit 5a32b38

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

examples/using_bodies_in_chunks/simple_request.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,14 @@ int process_intervention(modsecurity::Transaction *transaction)
103103

104104
std::cout << "Log: " << intervention.log << std::endl;
105105
free(intervention.log);
106+
intervention.log = NULL;
106107

107108
if (intervention.url != NULL)
108109
{
109110
std::cout << "Intervention, redirect to: " << intervention.url;
110111
std::cout << " with status code: " << intervention.status << std::endl;
111112
free(intervention.url);
113+
intervention.url = NULL;
112114
return intervention.status;
113115
}
114116

0 commit comments

Comments
 (0)