1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-12 12:35:04 -05:00

gnutls: fix memory leaks (certfields memory wasn't released)

Closes #6153
This commit is contained in:
Harry Sintonen 2020-11-01 23:32:15 +02:00 committed by Daniel Stenberg
parent 95d30409be
commit 8bcb23593e
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -1225,13 +1225,18 @@ gtls_connect_step3(struct connectdata *conn,
certclock = gnutls_x509_crt_get_expiration_time(x509_cert); certclock = gnutls_x509_crt_get_expiration_time(x509_cert);
showtime(data, "expire date", certclock); showtime(data, "expire date", certclock);
gnutls_free(certfields.data);
} }
rc = gnutls_x509_crt_get_issuer_dn2(x509_cert, &certfields); rc = gnutls_x509_crt_get_issuer_dn2(x509_cert, &certfields);
if(rc) if(rc)
infof(data, "Failed to get certificate issuer\n"); infof(data, "Failed to get certificate issuer\n");
else else {
infof(data, "\t issuer: %s\n", certfields.data); infof(data, "\t issuer: %s\n", certfields.data);
gnutls_free(certfields.data);
}
#endif #endif
gnutls_x509_crt_deinit(x509_cert); gnutls_x509_crt_deinit(x509_cert);