From aeceaf293cf4054b35bceece1b72344b163d0159 Mon Sep 17 00:00:00 2001 From: Rajeev Ranjan Date: Sun, 7 Jan 2024 00:28:35 +0100 Subject: [PATCH] cmp_kemrsa.c: fix memory leak --- crypto/cmp/cmp_kemrsa.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crypto/cmp/cmp_kemrsa.c b/crypto/cmp/cmp_kemrsa.c index 207fecfb1976e3..6e46a21f14d0fb 100644 --- a/crypto/cmp/cmp_kemrsa.c +++ b/crypto/cmp/cmp_kemrsa.c @@ -52,8 +52,9 @@ X509_ALGOR *ossl_cmp_rsakem_algor(OSSL_CMP_CTX *ctx) ASN1_STRING *stmp = NULL; if ((param = OSSL_CMP_RSAKEMPARAMETERS_new()) == NULL - || (param->KeyDerivationFunction - = ossl_cmp_kem_kdf_algor(ctx, NID_id_kdf_kdf2)) == NULL + || !ossl_cmp_x509_algor_set0(¶m->KeyDerivationFunction, + ossl_cmp_kem_kdf_algor(ctx, + NID_id_kdf_kdf2)) || !ASN1_INTEGER_set(param->KeyLength, RSAKEM_KEYLENGTH)) goto err;