File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -474,11 +474,9 @@ int main(int argc, char **argv) {
474474 ModSecurityTest<RegressionTest> test;
475475
476476 std::string ver (MODSECURITY_VERSION);
477- std::string envvar (" MODSECURITY= ModSecurity " + ver + " regression tests" );
477+ std::string envvar (" ModSecurity " + ver + " regression tests" );
478478
479- char *envvarptr = strdup (envvar.c_str ());
480-
481- putenv (envvarptr);
479+ setenv (" MODSECURITY" , envvar.c_str (), 1 );
482480#ifndef NO_LOGS
483481 int test_number = 0 ;
484482#endif
@@ -538,9 +536,6 @@ int main(int argc, char **argv) {
538536
539537 if (test.m_count_all ) {
540538 std::cout << std::to_string (keyList.size ()) << std::endl;
541- if (envvarptr != nullptr ) {
542- free (envvarptr);
543- }
544539 exit (0 );
545540 }
546541
@@ -611,9 +606,6 @@ int main(int argc, char **argv) {
611606 }
612607
613608#endif
614- if (envvarptr != nullptr ) {
615- free (envvarptr);
616- }
617609
618610 return 0 ;
619611}
You can’t perform that action at this time.
0 commit comments