diff options
author | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2023-05-30 21:14:51 +0200 |
---|---|---|
committer | Dr. David von Oheimb <dev@ddvo.net> | 2023-06-01 10:03:06 +0200 |
commit | dea5e2632ca7f3ab48f947359501a7e3f28db178 (patch) | |
tree | 7b34c666ac95d1b137e2f2ee64b522ddb770e6c1 /apps/cmp.c | |
parent | apps/cmp.c: improve warnings on option use (diff) | |
download | openssl-dea5e2632ca7f3ab48f947359501a7e3f28db178.tar.xz openssl-dea5e2632ca7f3ab48f947359501a7e3f28db178.zip |
apps/cmp.c: make management of http_cb_arg pointer more robust
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/21086)
Diffstat (limited to 'apps/cmp.c')
-rw-r--r-- | apps/cmp.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/apps/cmp.c b/apps/cmp.c index 18fd16625f..fa2f49585f 100644 --- a/apps/cmp.c +++ b/apps/cmp.c @@ -1984,6 +1984,7 @@ static int setup_client_ctx(OSSL_CMP_CTX *ctx, ENGINE *engine) if ((info = OPENSSL_zalloc(sizeof(*info))) == NULL) goto err; + APP_HTTP_TLS_INFO_free(OSSL_CMP_CTX_get_http_cb_arg(ctx)); (void)OSSL_CMP_CTX_set_http_cb_arg(ctx, info); info->ssl_ctx = setup_ssl_ctx(ctx, host, engine); info->server = host; @@ -3158,6 +3159,7 @@ int cmp_main(int argc, char **argv) #ifndef OPENSSL_NO_SOCK APP_HTTP_TLS_INFO *info = OSSL_CMP_CTX_get_http_cb_arg(cmp_ctx); + (void)OSSL_CMP_CTX_set_http_cb_arg(cmp_ctx, NULL); #endif ossl_cmp_mock_srv_free(OSSL_CMP_CTX_get_transfer_cb_arg(cmp_ctx)); X509_STORE_free(OSSL_CMP_CTX_get_certConf_cb_arg(cmp_ctx)); |