Fix potential memory leak.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/38/head
Slávek Banko 6 years ago
parent c84d8d813c
commit 686de3c7b7
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -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 */

Loading…
Cancel
Save