1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-04 16:45:06 -05:00

ngtcp2+gnutls: clear credentials when freed

... to avoid double-free.

Reported-by: Kenneth Davidson
Fixes #6824
Closes #6856
This commit is contained in:
Daniel Stenberg 2021-04-06 17:24:31 +02:00
parent 4b4401e26a
commit 33ddef3617
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -873,8 +873,10 @@ static void qs_disconnect(struct quicsocket *qs)
#endif
qs->ssl = NULL;
#ifdef USE_GNUTLS
if(qs->cred)
if(qs->cred) {
gnutls_certificate_free_credentials(qs->cred);
qs->cred = NULL;
}
#endif
for(i = 0; i < 3; i++)
Curl_safefree(qs->crypto_data[i].buf);