summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2019-02-06 23:37:44 +0100
committerSlávek Banko <slavek.banko@axis.cz>2019-02-06 23:37:44 +0100
commit686de3c7b7255af6b1a8543e7ff7c5d1aaabb87b (patch)
treefb712a79cf8f2f280c150036202320b4ef53b1f6
parentc84d8d813c97c6d9f518bd77a4cf2a99b01a12a0 (diff)
downloadtdenetwork-686de3c7b7255af6b1a8543e7ff7c5d1aaabb87b.tar.gz
tdenetwork-686de3c7b7255af6b1a8543e7ff7c5d1aaabb87b.zip
Fix potential memory leak.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r--krdc/vnc/rfbproto.c4
1 files changed, 3 insertions, 1 deletions
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 */