]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Address Coverity 1493362 resource leak
authorPauli <pauli@openssl.org>
Thu, 4 Nov 2021 05:05:59 +0000 (15:05 +1000)
committerPauli <pauli@openssl.org>
Sun, 7 Nov 2021 22:55:32 +0000 (08:55 +1000)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16962)

providers/implementations/keymgmt/mac_legacy_kmgmt.c

index 63553996bd993db307561f39e0bf90ab8fc41873..ec34a3ee71318ac3113f8781f3ac165b755fa2a4 100644 (file)
@@ -508,6 +508,7 @@ static void *mac_gen(void *genctx, OSSL_CALLBACK *cb, void *cbarg)
      * of this can be removed and we will only support the EVP_KDF APIs.
      */
     if (!ossl_prov_cipher_copy(&key->cipher, &gctx->cipher)) {
+        ossl_mac_key_free(key);
         ERR_raise(ERR_LIB_PROV, ERR_R_INTERNAL_ERROR);
         return NULL;
     }