Fix a memleak in ec_GFp_mont_group_set_curve.
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Sun, 2 Jul 2017 10:32:47 +0000 (12:32 +0200)
committerBernd Edlinger <bernd.edlinger@hotmail.de>
Sun, 2 Jul 2017 10:32:47 +0000 (12:32 +0200)
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3828)

crypto/ec/ecp_mont.c

index b2de7faea75e9d9a71b065b678abe7087181cd24..43c4330cb0b7c82621154aa54669e3778fab41f3 100644 (file)
@@ -247,6 +247,8 @@ int ec_GFp_mont_group_set_curve(EC_GROUP *group, const BIGNUM *p,
         BN_CTX_free(new_ctx);
     if (mont != NULL)
         BN_MONT_CTX_free(mont);
+    if (one != NULL)
+        BN_free(one);
     return ret;
 }