context_init: Fix cleanup in error handling
authorTomas Mraz <tomas@openssl.org>
Thu, 16 Dec 2021 15:06:34 +0000 (16:06 +0100)
committerTomas Mraz <tomas@openssl.org>
Fri, 17 Dec 2021 16:59:36 +0000 (17:59 +0100)
commit7ca3bf792a4a085e6f2426ad51a41fca4d0b1b8c
treeb98faa0a43b27d9b0ca1a7063cbe6f2c9514d873
parent33df7cbe5e38feb0cf962386bcac061c3743ecf2
context_init: Fix cleanup in error handling

Also never use OSSL_LIB_CTX_free() on incompletely initialized context.

Fixes #17291

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17294)
crypto/context.c