]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Avoid resource leaks in do_ssl3_write
authorDmitry Belyavskiy <beldmit@gmail.com>
Mon, 1 Aug 2022 10:33:39 +0000 (12:33 +0200)
committerDmitry Belyavskiy <beldmit@gmail.com>
Tue, 2 Aug 2022 12:35:18 +0000 (14:35 +0200)
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)

ssl/record/rec_layer_s3.c

index af539a0ea1af05b6e177667ab14812accb67097d..05b49a21e3ac3043a15b05a109ba05937b0e018a 100644 (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;