nla->version = 3;
if (settings->NtlmSamFile)
+ {
nla->SamFile = _strdup(settings->NtlmSamFile);
+ if (!nla->SamFile)
+ {
+ free(nla->identity);
+ free(nla);
+ return NULL;
+ }
+ }
+
ZeroMemory(&nla->negoToken, sizeof(SecBuffer));
ZeroMemory(&nla->pubKeyAuth, sizeof(SecBuffer));
ZeroMemory(&nla->authInfo, sizeof(SecBuffer));
}
}
- if (nla->SamFile)
- {
- free(nla->SamFile);
- nla->SamFile = NULL;
- }
+ free(nla->SamFile);
+ nla->SamFile = NULL;
sspi_SecBufferFree(&nla->PublicKey);
sspi_SecBufferFree(&nla->tsCredentials);
password = _strdup((char*) identity->Password);
}
+ if ((identity->User && !user) || (identity->Domain && !domain) || (identity->Password && !password))
+ return FALSE;
+
if (user)
{
free(settings->Username);
{
free(settings->Domain);
settings->Domain = domain;
- user = NULL;
+ domain = NULL;
}
if (password)
if (!server)
return;
- if (server->ipcSocket)
- {
- free(server->ipcSocket);
- server->ipcSocket = NULL;
- }
+ free(server->ipcSocket);
+ server->ipcSocket = NULL;
- if (server->settings)
- {
- freerdp_settings_free(server->settings);
- server->settings = NULL;
- }
+ freerdp_settings_free(server->settings);
+ server->settings = NULL;
free(server);
}
const char* filename = (char*) pBuffer;
free(context->SamFile);
- context->SamFile = filename ? _strdup(filename) : NULL;
+ context->SamFile = NULL;
+
+ if (filename)
+ {
+ context->SamFile = _strdup(filename);
+
+ if (!context->SamFile)
+ return SEC_E_INSUFFICIENT_MEMORY;
+ }
return SEC_E_OK;
}