Browse Source

Fix a memleak in ec_GFp_mont_group_set_curve.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3828)
Bernd Edlinger 7 years ago
parent
commit
953a1665e2
1 changed files with 2 additions and 0 deletions
  1. 2 0
      crypto/ec/ecp_mont.c

+ 2 - 0
crypto/ec/ecp_mont.c

@@ -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;
 }