rdp redirect: do the necessary layering violation to avoid leaks

This commit is contained in:
Mads Kiilerich 2012-03-16 18:12:49 +01:00
parent f2766a6d49
commit fe3c12d44a
3 changed files with 13 additions and 7 deletions

View File

@ -128,10 +128,22 @@ boolean rdp_client_redirect(rdpRdp* rdp)
rdp_client_disconnect(rdp);
/* FIXME: this is a subset of rdp_free */
crypto_rc4_free(rdp->rc4_decrypt_key);
crypto_rc4_free(rdp->rc4_encrypt_key);
crypto_des3_free(rdp->fips_encrypt);
crypto_des3_free(rdp->fips_decrypt);
crypto_hmac_free(rdp->fips_hmac);
mcs_free(rdp->mcs);
nego_free(rdp->nego);
license_free(rdp->license);
transport_free(rdp->transport);
/* FIXME: this is a subset of settings_free */
freerdp_blob_free(settings->server_random);
freerdp_blob_free(settings->server_certificate);
xfree(settings->ip_address);
rdp->transport = transport_new(settings);
rdp->license = license_new(rdp);
rdp->nego = nego_new(rdp->transport);

View File

@ -941,8 +941,8 @@ void rdp_free(rdpRdp* rdp)
crypto_des3_free(rdp->fips_encrypt);
crypto_des3_free(rdp->fips_decrypt);
crypto_hmac_free(rdp->fips_hmac);
extension_free(rdp->extension);
settings_free(rdp->settings);
extension_free(rdp->extension);
transport_free(rdp->transport);
license_free(rdp->license);
input_free(rdp->input);

View File

@ -193,12 +193,6 @@ void redirection_free(rdpRedirection* redirection)
{
if (redirection != NULL)
{
//these four have already been freed in settings_free() and freerdp_string_free() checks for NULL
redirection->username.ascii = NULL;
redirection->domain.ascii = NULL;
redirection->targetNetAddress.ascii = NULL;
redirection->targetNetBiosName.ascii = NULL;
freerdp_string_free(&redirection->tsvUrl);
freerdp_string_free(&redirection->username);
freerdp_string_free(&redirection->domain);