Skip to content

Commit

Permalink
Fix CID 1164526 (Resource leak in object)
Browse files Browse the repository at this point in the history
stream_ was allocated in the constructor,
but the destructor did not free it.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil committed Apr 26, 2018
1 parent b87fc52 commit fbeb55c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/viewer/svutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,8 @@ void SVNetwork::Close() {
#else
close(stream_);
#endif
// Mark stream_ as invalid.
stream_ = -1;
}


Expand Down Expand Up @@ -448,6 +450,7 @@ SVNetwork::SVNetwork(const char* hostname, int port) {
}

SVNetwork::~SVNetwork() {
Close();
delete[] msg_buffer_in_;
}

Expand Down

0 comments on commit fbeb55c

Please sign in to comment.