openssl quic: fix memory leak

When a OpenSSL quic connection filter is aborted early, as the
server was not responding, the ssl instances where not closed
as they should.

Fixes #14720
Reported-by: ralfjunker on github
Closes #14724
This commit is contained in:
Stefan Eissing 2024-08-29 13:06:47 +02:00 committed by Daniel Stenberg
parent 6354b35dfe
commit 4abf2b9699
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -434,6 +434,8 @@ static void cf_osslq_destroy(struct Curl_cfilter *cf, struct Curl_easy *data)
CURL_TRC_CF(data, cf, "destroy");
if(ctx) {
CURL_TRC_CF(data, cf, "cf_osslq_destroy()");
if(ctx->tls.ossl.ssl)
cf_osslq_ctx_close(ctx);
cf_osslq_ctx_free(ctx);
}
cf->ctx = NULL;