libfreerdp-core: fix cloning of LoadBalanceInfo

This commit is contained in:
Marc-André Moreau 2014-09-26 15:18:40 -04:00
parent 9daa8bd36f
commit 2d40fe7644

View File

@ -517,6 +517,16 @@ rdpSettings* freerdp_settings_clone(rdpSettings* settings)
* Manual Code
*/
_settings->LoadBalanceInfo = NULL;
_settings->LoadBalanceInfoLength = 0;
if (settings->LoadBalanceInfo && settings->LoadBalanceInfoLength)
{
_settings->LoadBalanceInfo = (BYTE*) calloc(1, settings->LoadBalanceInfoLength + 2);
CopyMemory(_settings->LoadBalanceInfo, settings->LoadBalanceInfo, settings->LoadBalanceInfoLength);
_settings->LoadBalanceInfoLength = settings->LoadBalanceInfoLength;
}
if (_settings->ServerRandomLength)
{
_settings->ServerRandom = (BYTE*) malloc(_settings->ServerRandomLength);