Commit aa545311 authored by steven_carr's avatar steven_carr

Security Type memory leak plugged. Leaks when rfb >= 3.7 clients connects.

The security list would grow 1 entry when clients connect.
parent 3dff7658
...@@ -129,6 +129,13 @@ rfbVncAuthSendChallenge(rfbClientPtr cl) ...@@ -129,6 +129,13 @@ rfbVncAuthSendChallenge(rfbClientPtr cl)
* Different security types will be added by applications using this library. * Different security types will be added by applications using this library.
*/ */
static rfbSecurityHandler primaryVncSecurityHandler = {
1,
rfbVncAuthSendChallenge,
NULL
};
static void static void
rfbSendSecurityTypeList(rfbClientPtr cl, int primaryType) rfbSendSecurityTypeList(rfbClientPtr cl, int primaryType)
{ {
...@@ -141,11 +148,8 @@ 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. */ /* Fill in the list of security types in the client structure. */
if (primaryType != rfbSecTypeInvalid) { if (primaryType != rfbSecTypeInvalid) {
rfbSecurityHandler* handler = calloc(sizeof(rfbSecurityHandler),1); primaryVncSecurityHandler.type = primaryType;
handler->type = primaryType; rfbRegisterSecurityHandler(&primaryVncSecurityHandler);
handler->handler = rfbVncAuthSendChallenge;
handler->next = NULL;
rfbRegisterSecurityHandler(handler);
} }
for (handler = securityHandlers; for (handler = securityHandlers;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment