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 b2de7fa..43c4330 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;
 }