Replaced manual settings value allocation with setter
@@ -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;
