libfreerdp-core: avoid reusing LoadBalanceInfo on reconnection

This commit is contained in:
Marc-André Moreau 2014-04-30 17:47:37 -04:00
parent c2a59c23a7
commit 5b0822a437
1 changed files with 24 additions and 15 deletions

View File

@ -103,21 +103,30 @@ int rdp_redirection_apply_settings(rdpRdp* rdp)
}
else
{
if (settings->RedirectionFlags & LB_TARGET_FQDN)
{
free(settings->RedirectionTargetFQDN);
settings->RedirectionTargetFQDN = _strdup(redirection->TargetFQDN);
}
else if (settings->RedirectionFlags & LB_TARGET_NET_ADDRESS)
{
free(settings->TargetNetAddress);
settings->TargetNetAddress = _strdup(redirection->TargetNetAddress);
}
else if (settings->RedirectionFlags & LB_TARGET_NETBIOS_NAME)
{
free(settings->RedirectionTargetNetBiosName);
settings->RedirectionTargetNetBiosName = _strdup(redirection->TargetNetBiosName);
}
/**
* Free previous LoadBalanceInfo, if any, otherwise it may end up
* being reused for the redirected session, which is not what we want.
*/
free(settings->LoadBalanceInfo);
settings->LoadBalanceInfo = NULL;
settings->LoadBalanceInfoLength = 0;
}
if (settings->RedirectionFlags & LB_TARGET_FQDN)
{
free(settings->RedirectionTargetFQDN);
settings->RedirectionTargetFQDN = _strdup(redirection->TargetFQDN);
}
else if (settings->RedirectionFlags & LB_TARGET_NET_ADDRESS)
{
free(settings->TargetNetAddress);
settings->TargetNetAddress = _strdup(redirection->TargetNetAddress);
}
else if (settings->RedirectionFlags & LB_TARGET_NETBIOS_NAME)
{
free(settings->RedirectionTargetNetBiosName);
settings->RedirectionTargetNetBiosName = _strdup(redirection->TargetNetBiosName);
}
if (settings->RedirectionFlags & LB_USERNAME)