From: Sreeja Athirkandathil Narayanan (sathirka) Date: Thu, 8 Dec 2022 16:44:34 +0000 (+0000) Subject: Pull request #3692: appid: fixed assert condition for odp_ctxt and odp_thread_local_ctxt X-Git-Tag: 3.1.49.0~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f31c4541d0f46d867401c04938d514bef99b1987;p=thirdparty%2Fsnort3.git Pull request #3692: appid: fixed assert condition for odp_ctxt and odp_thread_local_ctxt Merge in SNORT/snort3 from ~BSACHDEV/snort3:luafix to master Squashed commit of the following: commit 3f1bad59caaea21559a1189d92263fd90da06a9e Author: bsachdev Date: Fri Dec 2 11:43:52 2022 -0500 appid: fixed assert condition for odp_ctxt and odp_thread_local_ctxt --- diff --git a/src/network_inspectors/appid/appid_config.cc b/src/network_inspectors/appid/appid_config.cc index 1a552ee8f..7af81f52b 100644 --- a/src/network_inspectors/appid/appid_config.cc +++ b/src/network_inspectors/appid/appid_config.cc @@ -92,13 +92,17 @@ void AppIdConfig::show() const void AppIdContext::pterm() { - assert(odp_ctxt); - odp_ctxt->get_app_info_mgr().cleanup_appid_info_table(); - delete odp_ctxt; + if (odp_ctxt) + { + odp_ctxt->get_app_info_mgr().cleanup_appid_info_table(); + delete odp_ctxt; + } - assert(odp_thread_local_ctxt); - delete odp_thread_local_ctxt; - odp_thread_local_ctxt = nullptr; + if (odp_thread_local_ctxt) + { + delete odp_thread_local_ctxt; + odp_thread_local_ctxt = nullptr; + } } bool AppIdContext::init_appid(SnortConfig* sc, AppIdInspector& inspector)