Browse Source

Merge pull request #177 from robertfoss/asan_1

Fixed memory leak: delete -> delete[]
pull/178/head
orignal 10 years ago
parent
commit
e9edc7b205
  1. 2
      RouterInfo.cpp
  2. 2
      RouterInfo.h

2
RouterInfo.cpp

@ -36,7 +36,7 @@ namespace data
RouterInfo::~RouterInfo () RouterInfo::~RouterInfo ()
{ {
delete m_Buffer; delete[] m_Buffer;
} }
void RouterInfo::Update (const uint8_t * buf, int len) void RouterInfo::Update (const uint8_t * buf, int len)

2
RouterInfo.h

@ -142,7 +142,7 @@ namespace data
void SaveProfile () { if (m_Profile) m_Profile->Save (); }; void SaveProfile () { if (m_Profile) m_Profile->Save (); };
void Update (const uint8_t * buf, int len); void Update (const uint8_t * buf, int len);
void DeleteBuffer () { delete m_Buffer; m_Buffer = nullptr; }; void DeleteBuffer () { delete[] m_Buffer; m_Buffer = nullptr; };
// implements RoutingDestination // implements RoutingDestination
const IdentHash& GetIdentHash () const { return m_RouterIdentity.GetIdentHash (); }; const IdentHash& GetIdentHash () const { return m_RouterIdentity.GetIdentHash (); };

Loading…
Cancel
Save