]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Pull request #3692: appid: fixed assert condition for odp_ctxt and odp_thread_local_ctxt
authorSreeja Athirkandathil Narayanan (sathirka) <sathirka@cisco.com>
Thu, 8 Dec 2022 16:44:34 +0000 (16:44 +0000)
committerSreeja Athirkandathil Narayanan (sathirka) <sathirka@cisco.com>
Thu, 8 Dec 2022 16:44:34 +0000 (16:44 +0000)
Merge in SNORT/snort3 from ~BSACHDEV/snort3:luafix to master

Squashed commit of the following:

commit 3f1bad59caaea21559a1189d92263fd90da06a9e
Author: bsachdev <bsachdev@cisco.com>
Date:   Fri Dec 2 11:43:52 2022 -0500

    appid: fixed assert condition for odp_ctxt and odp_thread_local_ctxt

src/network_inspectors/appid/appid_config.cc

index 1a552ee8fc302f507953cee235bd93d169178965..7af81f52bdebea695199ee0d37ecda46102bdd1e 100644 (file)
@@ -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)