Skip to content

Commit

Permalink
Fix memory leak
Browse files Browse the repository at this point in the history
The char array for 'buffer' is not deallocated whenever a Buffer object is destroyed.  This commit addresses the issue.
  • Loading branch information
ayfchan committed Apr 17, 2015
1 parent c55b002 commit 875fa30
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/redispp.cpp
Expand Up @@ -264,6 +264,11 @@ class Buffer
Buffer(size_t bufferSize)
: buffer(new char[bufferSize]), spot(buffer), end(buffer + bufferSize), marked(buffer)
{}

~Buffer()
{
delete[] buffer;
}

void write(char c)
{
Expand Down

0 comments on commit 875fa30

Please sign in to comment.