A destructor must free the memory allocated by the constructor

This commit is contained in:
Julien Sentier 2012-02-23 13:21:47 +01:00 committed by Robin Sommer
parent 7dfb5657a2
commit 1df650eb0d
4 changed files with 13 additions and 0 deletions

View file

@ -42,6 +42,12 @@ Gnutella_Analyzer::Gnutella_Analyzer(Connection* conn)
resp_msg_state = new GnutellaMsgState();
}
Gnutella_Analyzer::~Gnutella_Analyzer()
{
delete orig_msg_state;
delete resp_msg_state;
}
void Gnutella_Analyzer::Done()
{
TCP_ApplicationAnalyzer::Done();

View file

@ -35,6 +35,7 @@ public:
class Gnutella_Analyzer : public TCP_ApplicationAnalyzer {
public:
Gnutella_Analyzer(Connection* conn);
~Gnutella_Analyzer();
virtual void Done ();
virtual void DeliverStream(int len, const u_char* data, bool orig);

View file

@ -225,5 +225,7 @@ NCP_Analyzer::NCP_Analyzer(Connection* conn)
NCP_Analyzer::~NCP_Analyzer()
{
delete session;
delete o_ncp;
delete r_ncp;
}

View file

@ -135,6 +135,10 @@ NetSessions::~NetSessions()
delete SYN_OS_Fingerprinter;
delete pkt_profiler;
Unref(arp_analyzer);
if (discarder)
delete discarder;
if (stp_manager)
delete stp_manager;
}
void NetSessions::Done()