Skip to content
This repository has been archived by the owner on Feb 26, 2020. It is now read-only.

Commit

Permalink
Fixed a potential memory leak
Browse files Browse the repository at this point in the history
PacketReader & PacketWriter did not correctly cleanup the buffer
m_buffStart in the dtor.
  • Loading branch information
SneWs committed May 28, 2014
1 parent c2b02fc commit 99ebd91
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/PacketReader.cpp
Expand Up @@ -50,7 +50,7 @@ PacketReader::PacketReader (size_t _cbSize)

PacketReader::~PacketReader (void)
{
delete m_buffStart;
delete[] m_buffStart;
}

void PacketReader::skip()
Expand Down
2 changes: 1 addition & 1 deletion lib/PacketWriter.cpp
Expand Up @@ -48,7 +48,7 @@ PacketWriter::PacketWriter(size_t _cbSize)

PacketWriter::~PacketWriter(void)
{
delete m_buffStart;
delete[] m_buffStart;
}

// Push/increment write cursor
Expand Down

0 comments on commit 99ebd91

Please sign in to comment.