Browse code

Cleanup OpenSSL on program exit

Shawn Webb authored on 2014/05/10 06:09:29
Showing 7 changed files
... ...
@@ -445,5 +445,6 @@ int main(int argc, char *argv[])
445 445
 	close(fd);
446 446
     if (debug_flag)
447 447
 	printf("[clambc] Exiting\n");
448
+    cl_cleanup_crypto();
448 449
     return 0;
449 450
 }
... ...
@@ -488,5 +488,6 @@ int main(int argc, char **argv)
488 488
     cli_detect_environment(&env);
489 489
     print_platform(&env);
490 490
     print_build(&env);
491
+    cl_cleanup_crypto();
491 492
     return 0;
492 493
 }
... ...
@@ -744,6 +744,8 @@ int main(int argc, char **argv)
744 744
     logg_close();
745 745
     optfree(opts);
746 746
 
747
+    cl_cleanup_crypto();
748
+
747 749
     return ret;
748 750
 }
749 751
 
... ...
@@ -175,6 +175,7 @@ int main(int argc, char **argv)
175 175
 
176 176
     logg_close();
177 177
     optfree(opts);
178
+    cl_cleanup_crypto();
178 179
     exit(ret);
179 180
 }
180 181
 
... ...
@@ -193,6 +193,8 @@ int main(int argc, char **argv)
193 193
 
194 194
     optfree(opts);
195 195
 
196
+    cl_cleanup_crypto();
197
+
196 198
     return ret;
197 199
 }
198 200
 
... ...
@@ -3089,5 +3089,6 @@ int main(int argc, char **argv)
3089 3089
 	help();
3090 3090
 
3091 3091
     optfree(opts);
3092
+    cl_cleanup_crypto();
3092 3093
     return ret ? 1 : 0;
3093 3094
 }
... ...
@@ -986,6 +986,8 @@ int main(void)
986 986
     Suite *s;
987 987
     SRunner *sr;
988 988
 
989
+    cl_initialize_crypto();
990
+
989 991
     fpu_words  = get_fpu_endian();
990 992
   
991 993
     check_version_compatible();
... ...
@@ -1016,5 +1018,7 @@ int main(void)
1016 1016
     nf = srunner_ntests_failed(sr);
1017 1017
     srunner_free(sr);
1018 1018
 
1019
+    cl_cleanup_crypto();
1020
+
1019 1021
     return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
1020 1022
 }