Ensure the WPACKET gets cleaned up in the event of an error
authorMatt Caswell <matt@openssl.org>
Thu, 8 Sep 2016 09:00:56 +0000 (10:00 +0100)
committerMatt Caswell <matt@openssl.org>
Tue, 13 Sep 2016 08:41:21 +0000 (09:41 +0100)
Otherwise a mem leak can occur.

Reviewed-by: Rich Salz <rsalz@openssl.org>
ssl/statem/statem_clnt.c

index b6895f5762dcf067a54c9dd4149ae069a0c37447..4f123ddc981ebe8bc1f478c964b0ad8f8b73c568 100644 (file)
@@ -875,6 +875,7 @@ int tls_construct_client_hello(SSL *s)
     return 1;
  err:
     ossl_statem_set_error(s);
+    WPACKET_cleanup(&pkt);
     return 0;
 }