From: Matt Caswell Date: Sat, 4 Mar 2017 15:45:40 +0000 (+0000) Subject: Fix a memory leak on an error path X-Git-Tag: OpenSSL_1_1_1-pre1~2115 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=312e9387fddacbcef4148bd3ace25c7db89e374e;p=oweals%2Fopenssl.git Fix a memory leak on an error path A leak of an SSL_SESSION object can occur when decoding a psk extension on an error path when using TLSv1.3 Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/2843) --- diff --git a/ssl/statem/extensions_srvr.c b/ssl/statem/extensions_srvr.c index 83fb71313a..ab3ad468fb 100644 --- a/ssl/statem/extensions_srvr.c +++ b/ssl/statem/extensions_srvr.c @@ -796,6 +796,7 @@ int tls_parse_ctos_psk(SSL *s, PACKET *pkt, unsigned int context, X509 *x, s->session = sess; return 1; err: + SSL_SESSION_free(sess); return 0; }