Coverity 1507484: dereference before null check

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18907)
This commit is contained in:
Pauli 2022-07-29 12:08:04 +10:00 committed by Hugo Landau
parent 83ab43da0c
commit 76ad9ae6fa

View File

@ -90,9 +90,9 @@ int SSL_SRP_CTX_free(SSL *s)
*/
int ssl_srp_ctx_init_intern(SSL_CONNECTION *s)
{
SSL_CTX *ctx = SSL_CONNECTION_GET_CTX(s);
SSL_CTX *ctx;
if (s == NULL || ctx == NULL)
if (s == NULL || (ctx = SSL_CONNECTION_GET_CTX(s)) == NULL)
return 0;
memset(&s->srp_ctx, 0, sizeof(s->srp_ctx));