openssl: fix a potential memory leak of params.cert

Closes #19560
This commit is contained in:
x2018 2025-11-17 14:12:14 +08:00 committed by Daniel Stenberg
parent a6c940a752
commit 22b8a6430d
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -1214,6 +1214,7 @@ static int engineload(struct Curl_easy *data,
failf(data, "unable to set client certificate [%s]",
ossl_strerror(ERR_get_error(), error_buffer,
sizeof(error_buffer)));
X509_free(params.cert);
return 0;
}
X509_free(params.cert); /* we do not need the handle any more... */