Address Coverity 1493362 resource leak

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16962)

(cherry picked from commit 1b4d9967a2)
This commit is contained in:
Pauli 2021-11-04 15:05:59 +10:00
parent 571512aa46
commit 2d35559743
1 changed files with 1 additions and 0 deletions

View 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. * of this can be removed and we will only support the EVP_KDF APIs.
*/ */
if (!ossl_prov_cipher_copy(&key->cipher, &gctx->cipher)) { if (!ossl_prov_cipher_copy(&key->cipher, &gctx->cipher)) {
ossl_mac_key_free(key);
ERR_raise(ERR_LIB_PROV, ERR_R_INTERNAL_ERROR); ERR_raise(ERR_LIB_PROV, ERR_R_INTERNAL_ERROR);
return NULL; return NULL;
} }