From: Viktor Dukhovni Date: Fri, 9 Feb 2018 23:34:33 +0000 (-0500) Subject: Avoid leaking peername data via accept BIOs X-Git-Tag: OpenSSL_1_1_0h~80 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=04f53be990f9d1d7c5f7b8f10568df6ebafccf65;p=oweals%2Fopenssl.git Avoid leaking peername data via accept BIOs Reviewed-by: Rich Salz (cherry picked from commit 4e0752535eb87b9aab4cf193f4422b5801ab7b32) --- diff --git a/crypto/bio/bss_acpt.c b/crypto/bio/bss_acpt.c index f0fe7f0a8e..4be4781d55 100644 --- a/crypto/bio/bss_acpt.c +++ b/crypto/bio/bss_acpt.c @@ -271,6 +271,11 @@ static int acpt_state(BIO *b, BIO_ACCEPT *c) BIO_clear_retry_flags(b); b->retry_reason = 0; + OPENSSL_free(c->cache_peer_name); + c->cache_peer_name = NULL; + OPENSSL_free(c->cache_peer_serv); + c->cache_peer_serv = NULL; + s = BIO_accept_ex(c->accept_sock, &c->cache_peer_addr, c->accepted_mode);