wolfssl: fix a potential memory leak of session

Closes #19555
This commit is contained in:
x2018 2025-11-17 01:52:02 +08:00 committed by Daniel Stenberg
parent c07a7f6bf8
commit 205a8e861f
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -581,8 +581,10 @@ wssl_setup_session(struct Curl_cfilter *cf,
bool do_early_data = FALSE;
if(sess_reuse_cb) {
result = sess_reuse_cb(cf, data, alpns, scs, &do_early_data);
if(result)
if(result) {
wolfSSL_SESSION_free(session);
goto out;
}
}
#ifdef WOLFSSL_EARLY_DATA
if(do_early_data) {