From 9f9254504ef9326187a3638e172b349c26af5170 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Tue, 28 Mar 2017 14:33:02 +0200 Subject: [PATCH] Fixed leak of client random. --- libfreerdp/core/connection.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libfreerdp/core/connection.c b/libfreerdp/core/connection.c index 71e7adad2..57896d275 100644 --- a/libfreerdp/core/connection.c +++ b/libfreerdp/core/connection.c @@ -573,12 +573,17 @@ BOOL rdp_server_establish_keys(rdpRdp* rdp, wStream* s) if (rand_len != key_len + 8) { WLog_ERR(TAG, "invalid encrypted client random length"); + free(client_random); goto end; } crypt_client_random = calloc(1, rand_len); if (!crypt_client_random) + { + free(client_random); goto end; + } + Stream_Read(s, crypt_client_random, rand_len); mod = rdp->settings->RdpServerRsaKey->Modulus;