diff options
author | Slávek Banko <[email protected]> | 2019-02-06 23:37:44 +0100 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2019-02-06 23:37:44 +0100 |
commit | 686de3c7b7255af6b1a8543e7ff7c5d1aaabb87b (patch) | |
tree | fb712a79cf8f2f280c150036202320b4ef53b1f6 | |
parent | c84d8d813c97c6d9f518bd77a4cf2a99b01a12a0 (diff) | |
download | tdenetwork-686de3c7b7255af6b1a8543e7ff7c5d1aaabb87b.tar.gz tdenetwork-686de3c7b7255af6b1a8543e7ff7c5d1aaabb87b.zip |
Fix potential memory leak.
Signed-off-by: Slávek Banko <[email protected]>
-rw-r--r-- | krdc/vnc/rfbproto.c | 4 |
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 */ |