Fix: Address a few benign memory leaks
This patch is the result of static analysis identifying a number of memory leaks. The leaks are all benign as they are a result of not deallocating memory in the desctructor. The fix still has value as it removes false positives in the static analysis.
This commit is contained in:
@@ -84,6 +84,11 @@ Pl111::Pl111(const Params *p)
|
||||
vncserver->setFramebufferAddr(dmaBuffer);
|
||||
}
|
||||
|
||||
Pl111::~Pl111()
|
||||
{
|
||||
delete[] dmaBuffer;
|
||||
}
|
||||
|
||||
// read registers and frame buffer
|
||||
Tick
|
||||
Pl111::read(PacketPtr pkt)
|
||||
|
||||
@@ -316,6 +316,7 @@ class Pl111: public AmbaDmaDevice
|
||||
return dynamic_cast<const Params *>(_params);
|
||||
}
|
||||
Pl111(const Params *p);
|
||||
~Pl111();
|
||||
|
||||
virtual Tick read(PacketPtr pkt);
|
||||
virtual Tick write(PacketPtr pkt);
|
||||
|
||||
@@ -147,6 +147,7 @@ EtherTap::~EtherTap()
|
||||
if (buffer)
|
||||
delete [] buffer;
|
||||
|
||||
delete interface;
|
||||
delete listener;
|
||||
}
|
||||
|
||||
|
||||
@@ -122,6 +122,11 @@ IGbE::IGbE(const Params *p)
|
||||
txFifo.clear();
|
||||
}
|
||||
|
||||
IGbE::~IGbE()
|
||||
{
|
||||
delete etherInt;
|
||||
}
|
||||
|
||||
void
|
||||
IGbE::init()
|
||||
{
|
||||
@@ -827,6 +832,8 @@ template<class T>
|
||||
IGbE::DescCache<T>::~DescCache()
|
||||
{
|
||||
reset();
|
||||
delete[] fetchBuf;
|
||||
delete[] wbBuf;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
|
||||
@@ -518,7 +518,7 @@ class IGbE : public EtherDevice
|
||||
}
|
||||
|
||||
IGbE(const Params *params);
|
||||
~IGbE() {}
|
||||
~IGbE();
|
||||
virtual void init();
|
||||
|
||||
virtual EtherInt *getEthPort(const std::string &if_name, int idx);
|
||||
|
||||
@@ -135,7 +135,9 @@ NSGigE::NSGigE(Params *p)
|
||||
}
|
||||
|
||||
NSGigE::~NSGigE()
|
||||
{}
|
||||
{
|
||||
delete interface;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is to write to the PCI general configuration registers
|
||||
|
||||
Reference in New Issue
Block a user