Fix memory leaks on certificate handling

Certificates initialized with gnutls_x509_crt_init() must be freed with
gnutls_x509_crt_deinit().
Memory allocated with malloc() should be freed with free() not
gnutls_free().
This commit is contained in:
Markus Beth 2019-02-04 00:31:23 +01:00
parent 116e125139
commit 35d8c932ab

3
ssl.c
View File

@ -156,7 +156,8 @@ rdssl_cert_read(uint8 * data, uint32 len)
void void
rdssl_cert_free(RDSSL_CERT * cert) rdssl_cert_free(RDSSL_CERT * cert)
{ {
gnutls_free(cert); gnutls_x509_crt_deinit(*cert);
free(cert);
} }