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) {
474
474
ModSecurityTest<RegressionTest> test;
475
475
476
476
std::string ver (MODSECURITY_VERSION);
477
- std::string envvar (" MODSECURITY= ModSecurity " + ver + " regression tests" );
477
+ std::string envvar (" ModSecurity " + ver + " regression tests" );
478
478
479
- char *envvarptr = strdup (envvar.c_str ());
480
-
481
- putenv (envvarptr);
479
+ setenv (" MODSECURITY" , envvar.c_str (), 1 );
482
480
#ifndef NO_LOGS
483
481
int test_number = 0 ;
484
482
#endif
@@ -538,9 +536,6 @@ int main(int argc, char **argv) {
538
536
539
537
if (test.m_count_all ) {
540
538
std::cout << std::to_string (keyList.size ()) << std::endl;
541
- if (envvarptr != nullptr ) {
542
- free (envvarptr);
543
- }
544
539
exit (0 );
545
540
}
546
541
@@ -611,9 +606,6 @@ int main(int argc, char **argv) {
611
606
}
612
607
613
608
#endif
614
- if (envvarptr != nullptr ) {
615
- free (envvarptr);
616
- }
617
609
618
610
return 0 ;
619
611
}
You can’t perform that action at this time.
0 commit comments