Fix leak on error in tls_construct_cke_gost
authorMatt Caswell <matt@openssl.org>
Mon, 22 Aug 2016 21:17:20 +0000 (22:17 +0100)
committerMatt Caswell <matt@openssl.org>
Mon, 22 Aug 2016 23:19:15 +0000 (00:19 +0100)
Don't leak pke_ctx on error.

Reviewed-by: Tim Hudson <tjh@openssl.org>
ssl/statem/statem_clnt.c

index 8f250cd..ff42858 100644 (file)
@@ -2368,7 +2368,7 @@ static int tls_construct_cke_gost(SSL *s, unsigned char **p, int *len, int *al)
     if (pms == NULL) {
         *al = SSL_AD_INTERNAL_ERROR;
         SSLerr(SSL_F_TLS_CONSTRUCT_CKE_GOST, ERR_R_MALLOC_FAILURE);
-        return 0;
+        goto err;
     }
 
     if (EVP_PKEY_encrypt_init(pkey_ctx) <= 0