summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Doerffel <tobias.doerffel@gmail.com>2010-10-20 15:16:07 +0200
committerChristian Beier <dontmind@freeshell.org>2010-10-20 15:16:07 +0200
commit71ad3229f697a74bf633500200728d345be65410 (patch)
treef0b2a107e41e79a47d10a5578c10b7652328924e
parentfbb93c9efe9105c6bd74333ed144111f59ba60a8 (diff)
downloadlibtdevnc-71ad3229f697a74bf633500200728d345be65410.tar.gz
libtdevnc-71ad3229f697a74bf633500200728d345be65410.zip
In rfbSendDirContent() we have to make sure to call closedir() before
returning. This did not happen if rfbSendFileTransferMessage() failed. Signed-off-by: Christian Beier <dontmind@freeshell.org>
-rw-r--r--libvncserver/rfbserver.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libvncserver/rfbserver.c b/libvncserver/rfbserver.c
index 5f8d22a..b540f04 100644
--- a/libvncserver/rfbserver.c
+++ b/libvncserver/rfbserver.c
@@ -1244,7 +1244,11 @@ rfbBool rfbSendDirContent(rfbClientPtr cl, int length, char *buffer)
/*
rfbLog("rfbProcessFileTransfer() rfbDirContentRequest: rfbRDirContent: Sending \"%s\"\n", (char *)win32filename.cFileName);
*/
- if (rfbSendFileTransferMessage(cl, rfbDirPacket, rfbADirectory, 0, nOptLen, (char *)&win32filename)==FALSE) return FALSE;
+ if (rfbSendFileTransferMessage(cl, rfbDirPacket, rfbADirectory, 0, nOptLen, (char *)&win32filename)==FALSE)
+ {
+ closedir(dirp);
+ return FALSE;
+ }
}
}
}