Replaced manual settings value allocation with setter

This commit is contained in:
akallabeth 2021-09-17 09:23:31 +02:00 committed by akallabeth
parent 04a8ced567
commit c1e38b24a6

View File

@ -1361,10 +1361,8 @@ BOOL gcc_read_server_security_data(wStream* s, rdpMcs* mcs)
goto fail;
Stream_Read(s, settings->ServerCertificate, settings->ServerCertificateLength);
certificate_free(settings->RdpServerCertificate);
settings->RdpServerCertificate = certificate_new();
if (!settings->RdpServerCertificate)
if (!freerdp_settings_set_pointer_len(settings, FreeRDP_RdpServerCertificate, certificate_new(),
sizeof(rdpCertificate)))
goto fail;
data = settings->ServerCertificate;