summaryrefslogtreecommitdiffstats
path: root/libvncserver
diff options
context:
space:
mode:
authorsteven_carr <steven_carr>2006-05-29 00:56:40 +0000
committersteven_carr <steven_carr>2006-05-29 00:56:40 +0000
commitaa5453110744ab4cf549578781f9e4b2e99b900b (patch)
treed75d2ecba0da67770d4f918fa86ec0fb11862923 /libvncserver
parent3dff7658dcd42f6fb5fcd571155443f4525a48ca (diff)
downloadlibtdevnc-aa5453110744ab4cf549578781f9e4b2e99b900b.tar.gz
libtdevnc-aa5453110744ab4cf549578781f9e4b2e99b900b.zip
Security Type memory leak plugged. Leaks when rfb >= 3.7 clients connects.
The security list would grow 1 entry when clients connect.
Diffstat (limited to 'libvncserver')
-rwxr-xr-xlibvncserver/auth.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/libvncserver/auth.c b/libvncserver/auth.c
index 0994c53..2a8fcb4 100755
--- a/libvncserver/auth.c
+++ b/libvncserver/auth.c
@@ -129,6 +129,13 @@ rfbVncAuthSendChallenge(rfbClientPtr cl)
* Different security types will be added by applications using this library.
*/
+static rfbSecurityHandler primaryVncSecurityHandler = {
+ 1,
+ rfbVncAuthSendChallenge,
+ NULL
+};
+
+
static void
rfbSendSecurityTypeList(rfbClientPtr cl, int primaryType)
{
@@ -141,11 +148,8 @@ rfbSendSecurityTypeList(rfbClientPtr cl, int primaryType)
/* Fill in the list of security types in the client structure. */
if (primaryType != rfbSecTypeInvalid) {
- rfbSecurityHandler* handler = calloc(sizeof(rfbSecurityHandler),1);
- handler->type = primaryType;
- handler->handler = rfbVncAuthSendChallenge;
- handler->next = NULL;
- rfbRegisterSecurityHandler(handler);
+ primaryVncSecurityHandler.type = primaryType;
+ rfbRegisterSecurityHandler(&primaryVncSecurityHandler);
}
for (handler = securityHandlers;