apps/cmp.c: fix cleanup of CMP_CTX vs. APP_HTTP_TLS_INFO in its http_cb_arg field
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>
Fri, 1 Jul 2022 18:38:59 +0000 (20:38 +0200)
committerDr. David von Oheimb <dev@ddvo.net>
Mon, 11 Jul 2022 09:03:28 +0000 (11:03 +0200)
commit8c094747d78bb8627e9ca5241fed0550a3de2fdb
tree7e448f44f617cf1b8a55c3d3995764acd49d6164
parent93d9d6097685dc29e654db15c091c550aef16d5b
apps/cmp.c: fix cleanup of CMP_CTX vs. APP_HTTP_TLS_INFO in its http_cb_arg field

Prevent crashes on error by making sure the info is freed after OSSL_CMP_CTX_free(),
which may call OSSL_HTTP_close() and thus indirectly reference the info.
Moreover, should not attempt to reference the cmp_ctx variable when NULL.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/18702)
apps/cmp.c