cmdline post: cleanup in case of oom

This commit is contained in:
Bernhard Miklautz 2014-07-28 17:57:51 +02:00
parent f06490b426
commit 32bb18152a

View File

@ -114,23 +114,29 @@ static BOOL freerdp_client_settings_post_process(rdpSettings* settings)
{
settings->GatewayUsername = _strdup(settings->Username);
if (!settings->GatewayUsername)
return FALSE;
goto out_error;
}
if (settings->Domain)
{
settings->GatewayDomain = _strdup(settings->Domain);
if (!settings->GatewayDomain)
return FALSE;
goto out_error;
}
if (settings->Password)
{
settings->GatewayPassword = _strdup(settings->Password);
if (!settings->GatewayPassword)
return FALSE;
goto out_error;
}
}
}
return TRUE;
out_error:
free(settings->GatewayUsername);
free(settings->GatewayDomain);
free(settings->GatewayPassword);
return FALSE;
}