From: rcombs Date: Wed, 9 Jul 2014 06:11:38 +0000 (-0400) Subject: valgrind fixes X-Git-Tag: 3.0.0-233~1444^2~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f904bf8f915a9cd58718707e87ceb9595c31f3bb;p=thirdparty%2Fsnort3.git valgrind fixes --- diff --git a/lua/snort.lua b/lua/snort.lua index f578fc05b..3319314f4 100644 --- a/lua/snort.lua +++ b/lua/snort.lua @@ -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 = diff --git a/src/managers/packet_manager.cc b/src/managers/packet_manager.cc index d997bef65..005e15386 100644 --- a/src/managers/packet_manager.cc +++ b/src/managers/packet_manager.cc @@ -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; diff --git a/src/stream/tcp/tcp_module.cc b/src/stream/tcp/tcp_module.cc index b6dc7730c..cb41cb1fe 100644 --- a/src/stream/tcp/tcp_module.cc +++ b/src/stream/tcp/tcp_module.cc @@ -204,6 +204,12 @@ StreamTcpModule::StreamTcpModule() : config = nullptr; } +StreamTcpModule::~StreamTcpModule() +{ + for ( auto p : protos ) + delete p; +} + StreamTcpConfig* StreamTcpModule::get_data() { StreamTcpConfig* temp = config; diff --git a/src/stream/tcp/tcp_module.h b/src/stream/tcp/tcp_module.h index 236429c89..11d942110 100644 --- a/src/stream/tcp/tcp_module.h +++ b/src/stream/tcp/tcp_module.h @@ -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*);