diff --git a/libfreerdp/core/certificate.c b/libfreerdp/core/certificate.c index cf787c785..358f30589 100644 --- a/libfreerdp/core/certificate.c +++ b/libfreerdp/core/certificate.c @@ -348,14 +348,15 @@ static rdpX509CertChain* certificate_new_x509_certificate_chain(UINT32 count) static void certificate_free_x509_certificate_chain(rdpX509CertChain* x509_cert_chain) { - int i; + UINT32 i; if (!x509_cert_chain) return; - for (i = 0; i < (int)x509_cert_chain->count; i++) + for (i = 0; i < x509_cert_chain->count; i++) { - free(x509_cert_chain->array[i].data); + struct rdp_CertBlob* element = &x509_cert_chain->array[i]; + free(element->data); } free(x509_cert_chain->array);