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