summaryrefslogtreecommitdiffstats
path: root/libvncclient/vncviewer.c
diff options
context:
space:
mode:
authorRobbert Klarenbeek <robbertkl@users.sourceforge.net>2014-03-30 13:14:18 -0500
committerJohannes Schindelin <johannes.schindelin@gmx.de>2014-03-30 13:14:18 -0500
commitf2a93afb4660cfe206171756cb813b34b2ce0e7c (patch)
tree5a66c918f1014bd35430e33b2fd6c2bd4823ca5c /libvncclient/vncviewer.c
parentbd811bdee97a41d6e8ac19afbbcae27c1b0c2d6d (diff)
downloadlibtdevnc-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/vncviewer.c')
-rw-r--r--libvncclient/vncviewer.c6
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)