Remove an unnecessary call to BN_CTX_free.
authorAaron Thompson <dev@aaront.org>
Tue, 31 Mar 2020 07:19:16 +0000 (07:19 +0000)
committerTomas Mraz <tmraz@fedoraproject.org>
Fri, 3 Apr 2020 08:42:14 +0000 (10:42 +0200)
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/11452)

crypto/ec/ec_check.c

index 1283d8404f699849485446bbf4f21e66d52ea2c5..a4cc8073de1f6af1d9f3f770c379c798b1720b5e 100644 (file)
 int EC_GROUP_check_named_curve(const EC_GROUP *group, int nist_only,
                                BN_CTX *ctx)
 {
-    int nid = NID_undef;
+    int nid;
     BN_CTX *new_ctx = NULL;
 
     if (group == NULL) {
         ECerr(0, ERR_R_PASSED_NULL_PARAMETER);
-        goto err;
+        return NID_undef;
     }
 
     if (ctx == NULL) {
@@ -39,7 +39,6 @@ int EC_GROUP_check_named_curve(const EC_GROUP *group, int nist_only,
     if (nid > 0 && nist_only && EC_curve_nid2nist(nid) == NULL)
         nid = NID_undef;
 
-err:
     BN_CTX_free(new_ctx);
     return nid;
 }