]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #1148 in SNORT/snort3 from data_bus_leak to master
authorMichael Altizer (mialtize) <mialtize@cisco.com>
Tue, 20 Mar 2018 14:14:27 +0000 (10:14 -0400)
committerMichael Altizer (mialtize) <mialtize@cisco.com>
Tue, 20 Mar 2018 14:14:27 +0000 (10:14 -0400)
Squashed commit of the following:

commit 52d96033fbb424ba968de16a4628f5974d4d5d73
Author: Carter Waxman <cwaxman@cisco.com>
Date:   Mon Mar 19 15:09:18 2018 -0400

    DataBus: fixed creating DataHandler when one doesn't exist

src/framework/data_bus.cc

index 4a07ad06bbcbacd01851d608940cd0de9bfa1719..79c39c562e28adaf1df79c23c14d82c18dc58794 100644 (file)
@@ -154,9 +154,12 @@ void DataBus::_unsubscribe(const char* key, DataHandler* h)
 // notify subscribers of event
 void DataBus::_publish(const char* key, DataEvent& e, Flow* f)
 {
-    DataList& v = map[key];
+    auto v = map.find(key);
 
-    for ( auto* h : v )
-        h->handle(e, f);
+    if ( v != map.end() )
+    {
+        for ( auto* h : v->second )
+            h->handle(e, f);
+    }
 }