From: Bernd Edlinger Date: Mon, 6 Nov 2023 09:44:27 +0000 (+0100) Subject: Fix a possible memory leak of ssl->s3.tmp.psk X-Git-Tag: openssl-3.1.5~157 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=115fc7d3e7e115a5fb4a38ecb0b886ae88627c89;p=thirdparty%2Fopenssl.git Fix a possible memory leak of ssl->s3.tmp.psk Reviewed-by: Matt Caswell Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/22637) (cherry picked from commit a2b1ab6100d5f0fb50b61d241471eea087415632) --- diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index 78d4f040565..460b84325d6 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -3365,6 +3365,10 @@ void ssl3_free(SSL *s) OPENSSL_free(s->s3.alpn_selected); OPENSSL_free(s->s3.alpn_proposed); +#ifndef OPENSSL_NO_PSK + OPENSSL_free(sc->s3.tmp.psk); +#endif + #ifndef OPENSSL_NO_SRP ssl_srp_ctx_free_intern(s); #endif