From: Matt Caswell Date: Thu, 8 Sep 2016 09:00:56 +0000 (+0100) Subject: Ensure the WPACKET gets cleaned up in the event of an error X-Git-Tag: OpenSSL_1_1_1-pre1~3563 X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff_plain;h=796a627e0a816ffbd79f53fa7d349e4edb624573;hp=871bc59bc190d24ddd7b29aeb5fb2493b48e9cf5 Ensure the WPACKET gets cleaned up in the event of an error Otherwise a mem leak can occur. Reviewed-by: Rich Salz --- diff --git a/ssl/statem/statem_clnt.c b/ssl/statem/statem_clnt.c index b6895f5762..4f123ddc98 100644 --- a/ssl/statem/statem_clnt.c +++ b/ssl/statem/statem_clnt.c @@ -875,6 +875,7 @@ int tls_construct_client_hello(SSL *s) return 1; err: ossl_statem_set_error(s); + WPACKET_cleanup(&pkt); return 0; }