diff options
author | Robbert Klarenbeek <robbertkl@users.sourceforge.net> | 2014-03-30 13:14:18 -0500 |
---|---|---|
committer | Johannes Schindelin <johannes.schindelin@gmx.de> | 2014-03-30 13:14:18 -0500 |
commit | f2a93afb4660cfe206171756cb813b34b2ce0e7c (patch) | |
tree | 5a66c918f1014bd35430e33b2fd6c2bd4823ca5c /libvncclient | |
parent | bd811bdee97a41d6e8ac19afbbcae27c1b0c2d6d (diff) | |
download | libtdevnc-f2a93afb4660cfe206171756cb813b34b2ce0e7c.tar.gz libtdevnc-f2a93afb4660cfe206171756cb813b34b2ce0e7c.zip |
Address #12 ClientData does not get freed
rfbClientSetClientData() allocates a new rfbClientData, but never gets
cleaned up, which causes memory leaks.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Diffstat (limited to 'libvncclient')
-rw-r--r-- | libvncclient/vncviewer.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libvncclient/vncviewer.c b/libvncclient/vncviewer.c index 8b09d87..3b16a6f 100644 --- a/libvncclient/vncviewer.c +++ b/libvncclient/vncviewer.c @@ -372,6 +372,12 @@ void rfbClientCleanup(rfbClient* client) { FreeTLS(client); + while (client->clientData) { + rfbClientData* next = client->clientData->next; + free(client->clientData); + client->clientData = next; + } + if (client->sock >= 0) close(client->sock); if (client->listenSock >= 0) |