update_register_server_callbacks(client->update);
autodetect_register_server_callbacks(client->autodetect);
+ if (!(context->errorDescription = calloc(1, 500)))
+ {
+ WLog_ERR(TAG, "calloc failed!");
+ goto fail_error_description;
+ }
+
if (!transport_attach(rdp->transport, client->sockfd))
goto fail_transport_attach;
WLog_ERR(TAG, "ContextNew callback failed");
fail_transport_attach:
+ free(context->errorDescription);
+fail_error_description:
rdp_free(client->context->rdp);
fail_rdp:
metrics_free(context->metrics);
{
IFCALL(client->ContextFree, client, client->context);
- metrics_free(client->context->metrics);
+ if (client->context)
+ {
+ free(client->context->errorDescription);
+ client->context->errorDescription = NULL;
+
+ rdp_free(client->context->rdp);
+ client->context->rdp = NULL;
+
+ metrics_free(client->context->metrics);
+ client->context->metrics = NULL;
+
+ free(client->context);
+ client->context = NULL;
+ }
}
freerdp_peer* freerdp_peer_new(int sockfd)
if (!client)
return;
- if (client->context)
- {
- rdp_free(client->context->rdp);
- free(client->context);
- }
free(client);
}
return context->CapsConfirm(context, &pdu);
}
- else if (pdu.capsSet->version == RDPGFX_CAPVERSION_81)
+ }
+ for (index = 0; index < capsAdvertise->capsSetCount; index++)
+ {
+ if (pdu.capsSet->version == RDPGFX_CAPVERSION_81)
{
if (settings)
{
return context->CapsConfirm(context, &pdu);
}
}
+ for (index = 0; index < capsAdvertise->capsSetCount; index++)
+ {
+ if (pdu.capsSet->version == RDPGFX_CAPVERSION_8)
+ {
+ if (settings)
+ {
+ flags = pdu.capsSet->flags;
+ settings->GfxThinClient = (flags & RDPGFX_CAPS_FLAG_THINCLIENT);
+ settings->GfxSmallCache = (flags & RDPGFX_CAPS_FLAG_SMALL_CACHE);
+ }
+
+ return context->CapsConfirm(context, &pdu);
+ }
+ }
return CHANNEL_RC_UNSUPPORTED_VERSION;
}