Avoid resource leaks in do_ssl3_write

Thanks Matt for pointing on it

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18924)
This commit is contained in:
Dmitry Belyavskiy 2022-08-01 12:33:39 +02:00
parent 4842a27b90
commit 771fef7793

View File

@ -876,7 +876,7 @@ int do_ssl3_write(SSL_CONNECTION *s, int type, const unsigned char *buf,
eivlen = EVP_CIPHER_CTX_get_iv_length(s->enc_write_ctx);
if (eivlen < 0) {
SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_LIBRARY_BUG);
return -1;
goto err;
}
if (eivlen <= 1)
eivlen = 0;