From fa62e5b48ce1dfd21cc15a7aebeb2142c7a2abc7 Mon Sep 17 00:00:00 2001 From: Tim Wojtulewicz Date: Mon, 26 Aug 2019 10:31:17 -0700 Subject: [PATCH] main: Properly close down SSL/sqlite at shutdown if net_run never started up --- src/main.cc | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/src/main.cc b/src/main.cc index 5f1a5c04cd..1bfaa5882d 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1101,24 +1101,20 @@ int main(int argc, char** argv) done_with_network(); net_delete(); - - terminate_bro(); - - sqlite3_shutdown(); - - ERR_free_strings(); - EVP_cleanup(); - CRYPTO_cleanup_all_ex_data(); - - // Close files after net_delete(), because net_delete() - // might write to connection content files. - BroFile::CloseOpenFiles(); - } - else - { - terminate_bro(); } + terminate_bro(); + + sqlite3_shutdown(); + + ERR_free_strings(); + EVP_cleanup(); + CRYPTO_cleanup_all_ex_data(); + + // Close files after net_delete(), because net_delete() + // might write to connection content files. + BroFile::CloseOpenFiles(); + delete rule_matcher; return 0;