aboutsummaryrefslogtreecommitdiff
path: root/crypto/cmp/cmp_client.c
diff options
context:
space:
mode:
authorEnji Cooper <ngie@FreeBSD.org>2025-07-11 00:18:38 +0000
committerEnji Cooper <ngie@FreeBSD.org>2025-07-11 00:18:38 +0000
commitecf8229ffeb17a05c78fab6b973b0cccb84e25c5 (patch)
treeda8cf5ccc84d9bc3fbadcf674c7d501f9ca7ab5d /crypto/cmp/cmp_client.c
parent1c34280346af8284acdc0eae39496811d37df25d (diff)
Diffstat (limited to 'crypto/cmp/cmp_client.c')
-rw-r--r--crypto/cmp/cmp_client.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/crypto/cmp/cmp_client.c b/crypto/cmp/cmp_client.c
index 4c8dbfdcd739..8950091b93ee 100644
--- a/crypto/cmp/cmp_client.c
+++ b/crypto/cmp/cmp_client.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2007-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2007-2025 The OpenSSL Project Authors. All Rights Reserved.
* Copyright Nokia 2007-2019
* Copyright Siemens AG 2015-2019
*
@@ -611,8 +611,10 @@ static int cert_response(OSSL_CMP_CTX *ctx, int sleep, int rid,
ERR_add_error_data(1, "; cannot extract certificate from response");
return 0;
}
- if (!ossl_cmp_ctx_set0_newCert(ctx, cert))
+ if (!ossl_cmp_ctx_set0_newCert(ctx, cert)) {
+ X509_free(cert);
return 0;
+ }
/*
* if the CMP server returned certificates in the caPubs field, copy them