Fix a memory leak in an error path
authorMatt Caswell <matt@openssl.org>
Mon, 12 Feb 2018 16:58:33 +0000 (16:58 +0000)
committerMatt Caswell <matt@openssl.org>
Wed, 14 Feb 2018 15:30:15 +0000 (15:30 +0000)
Found by Coverity.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/5336)

crypto/rsa/rsa_mp.c

index 97a09f1..7e38179 100644 (file)
@@ -51,6 +51,7 @@ RSA_PRIME_INFO *rsa_multip_info_new(void)
     BN_free(pinfo->d);
     BN_free(pinfo->t);
     BN_free(pinfo->pp);
     BN_free(pinfo->d);
     BN_free(pinfo->t);
     BN_free(pinfo->pp);
+    OPENSSL_free(pinfo);
     return NULL;
 }
 
     return NULL;
 }