diff options
author | Daniel Stenberg <daniel@haxx.se> | 2021-04-06 17:24:31 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-04-07 00:07:10 +0200 |
commit | 33ddef36177bbf9aeb09581e83b2b41438dfec2b (patch) | |
tree | c3b4eeed851eed2a4c67e71da3a29416f6827a44 | |
parent | 4b4401e26acd3a181706e890402ffb371899df2b (diff) | |
download | curl-33ddef36177bbf9aeb09581e83b2b41438dfec2b.tar.gz |
ngtcp2+gnutls: clear credentials when freed
... to avoid double-free.
Reported-by: Kenneth Davidson
Fixes #6824
Closes #6856
-rw-r--r-- | lib/vquic/ngtcp2.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/vquic/ngtcp2.c b/lib/vquic/ngtcp2.c index 9569431ca..69dd14074 100644 --- a/lib/vquic/ngtcp2.c +++ b/lib/vquic/ngtcp2.c @@ -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); |