]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
valgrind fixes
authorrcombs <rcombs@sq18.sfeng.sourcefire.com>
Wed, 9 Jul 2014 06:11:38 +0000 (02:11 -0400)
committerrcombs <rcombs@sq18.sfeng.sourcefire.com>
Wed, 9 Jul 2014 06:11:38 +0000 (02:11 -0400)
lua/snort.lua
src/managers/packet_manager.cc
src/stream/tcp/tcp_module.cc
src/stream/tcp/tcp_module.h

index f578fc05b8ef47684506cd9b98831c189cb46881..3319314f4197da4c2285cc305d1999b99efab947 100644 (file)
@@ -508,9 +508,10 @@ if ( not dir ) then
     dir = ''
 end
 
-include '../lua/classification.lua'
+--include '../lua/classification.lua'
 
 print 'Loading references'
+dofile(dir .. 'classification.lua')
 dofile(dir .. 'reference.lua')
 
 default_rules =
index d997bef65f581954b09272893e3e6a1f5f6d44f6..005e15386c4e0384874f9014453b7d46272a6201 100644 (file)
@@ -276,7 +276,7 @@ void PacketManager::release_plugins()
             p->gterm();
 
         uint8_t index = get_codec(p->base.name);
-        //if( index != 0)  FIXIT prevents calling dtor()
+        if( index != 0)
         {
             p->dtor(s_protocols[index]);
             s_protocols[index] = nullptr;
index b6dc7730c4a5fb1207eeb73d4b6ec492f89a118d..cb41cb1fef657e0c18d23a1ec6f9e21600b6e75f 100644 (file)
@@ -204,6 +204,12 @@ StreamTcpModule::StreamTcpModule() :
     config = nullptr;
 }
 
+StreamTcpModule::~StreamTcpModule()
+{
+    for ( auto p : protos )
+        delete p;
+}
+
 StreamTcpConfig* StreamTcpModule::get_data()
 {
     StreamTcpConfig* temp = config;
index 236429c89f2b1df925d2b9a488f5a673f82c38d9..11d9421103921bf5799451e177f7783986c87bd0 100644 (file)
@@ -73,6 +73,8 @@ class StreamTcpModule : public Module
 {
 public:
     StreamTcpModule();
+    ~StreamTcpModule();
+
     bool set(const char*, Value&, SnortConfig*);
     bool begin(const char*, int, SnortConfig*);
     bool end(const char*, int, SnortConfig*);