Skip to content

Commit 3acb43e

Browse files
libvncserver: fix memory leak on webclient disconnect
The webocket context was not free'd on client disconnect.
1 parent d62002e commit 3acb43e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/libvncserver/rfbserver.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,11 @@ rfbClientConnectionGone(rfbClientPtr cl)
607607

608608
rfbLog("Client %s gone\n",cl->host);
609609
free(cl->host);
610+
611+
if (cl->wsctx != NULL){
612+
free(cl->wsctx);
613+
cl->wsctx = NULL;
614+
}
610615

611616
#ifdef LIBVNCSERVER_HAVE_LIBZ
612617
/* Release the compression state structures if any. */

0 commit comments

Comments
 (0)