Coverity 1503321 & 1503327: dereference after null check
Coverity 1503321 & 1503327: dereference after null check

Reviewed-by: Tomas Mraz <2bc6038c3dfca09b2da23c8b6da8ba884dc2dcc2@openssl.org>
Reviewed-by: Dmitry Belyavskiy <38c64d6e24766247aad56af3a6ddb0056ad36a44@gmail.com>
Reviewed-by: Hugo Landau <ce9fa1e55a72fc9b85dd06e47ea2c07848fb7d2c@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18799)

openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl