coverity 1462576 Resource leak
authorPauli <paul.dale@oracle.com>
Sun, 26 Apr 2020 23:25:42 +0000 (09:25 +1000)
committerPauli <paul.dale@oracle.com>
Thu, 30 Apr 2020 10:21:33 +0000 (20:21 +1000)
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/11651)

crypto/ec/ecx_meth.c

index d23fcd4..a9c71f3 100644 (file)
@@ -95,7 +95,7 @@ static int ecx_key_op(EVP_PKEY *pkey, int id, const X509_ALGOR *palg,
         case EVP_PKEY_ED25519:
             if (!ED25519_public_from_private(libctx, pubkey, privkey)) {
                 ECerr(EC_F_ECX_KEY_OP, EC_R_FAILED_MAKING_PUBLIC_KEY);
         case EVP_PKEY_ED25519:
             if (!ED25519_public_from_private(libctx, pubkey, privkey)) {
                 ECerr(EC_F_ECX_KEY_OP, EC_R_FAILED_MAKING_PUBLIC_KEY);
-                return 0;
+                goto err;
             }
             break;
         case EVP_PKEY_X448:
             }
             break;
         case EVP_PKEY_X448:
@@ -104,7 +104,7 @@ static int ecx_key_op(EVP_PKEY *pkey, int id, const X509_ALGOR *palg,
         case EVP_PKEY_ED448:
             if (!ED448_public_from_private(libctx, pubkey, privkey)) {
                 ECerr(EC_F_ECX_KEY_OP, EC_R_FAILED_MAKING_PUBLIC_KEY);
         case EVP_PKEY_ED448:
             if (!ED448_public_from_private(libctx, pubkey, privkey)) {
                 ECerr(EC_F_ECX_KEY_OP, EC_R_FAILED_MAKING_PUBLIC_KEY);
-                return 0;
+                goto err;
             }
             break;
         }
             }
             break;
         }