Merge pull request #703 from Osirium/master

segfault if tls fails to initialize
This commit is contained in:
Marc-André Moreau 2012-08-22 07:29:27 -07:00
commit d76654be11

View File

@ -245,6 +245,9 @@ int credssp_client_authenticate(rdpCredssp* credssp)
while (true)
{
#ifdef WITH_DEBUG_CREDSSP
printf("credssp_client_authenticate loop");
#endif
output_buffer_desc.ulVersion = SECBUFFER_VERSION;
output_buffer_desc.cBuffers = 1;
output_buffer_desc.pBuffers = &output_buffer;
@ -258,7 +261,7 @@ int credssp_client_authenticate(rdpCredssp* credssp)
SECURITY_NATIVE_DREP, (have_input_buffer) ? &input_buffer_desc : NULL,
0, &credssp->context, &output_buffer_desc, &pfContextAttr, &expiration);
if (input_buffer.pvBuffer != NULL)
if (have_input_buffer && (input_buffer.pvBuffer != NULL))
{
free(input_buffer.pvBuffer);
input_buffer.pvBuffer = NULL;