From 686de3c7b7255af6b1a8543e7ff7c5d1aaabb87b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Wed, 6 Feb 2019 23:37:44 +0100 Subject: [PATCH] Fix potential memory leak. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- krdc/vnc/rfbproto.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/krdc/vnc/rfbproto.c b/krdc/vnc/rfbproto.c index 82aa9af2..c6e05c05 100644 --- a/krdc/vnc/rfbproto.c +++ b/krdc/vnc/rfbproto.c @@ -1143,8 +1143,10 @@ HandleRFBServerMessage() return False; } - if (!ReadFromRFBServer(serverCutText, msg.sct.length)) + if (!ReadFromRFBServer(serverCutText, msg.sct.length)) { + free(serverCutText); return False; + } serverCutText[msg.sct.length] = 0; newServerCut(serverCutText, msg.sct.length); /* takes ownership of serverCutText */