]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix BIO dgram pair memleak in dgram_mem_init
authorJakub Zelenka <jakub.zelenka@openssl.foundation>
Fri, 8 May 2026 14:41:08 +0000 (16:41 +0200)
committerEugene Syromiatnikov <esyr@openssl.org>
Mon, 11 May 2026 08:07:06 +0000 (10:07 +0200)
The created pair was not freed if ring buf init failed.

Fixes: 3a857b953216 "Implement BIO_s_dgram_mem() reusing the BIO_s_dgram_pair() code"
Reviewed-by: Matt Caswell <matt@openssl.foundation>
Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@gmail.com>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Mon May 11 08:09:14 2026
(Merged from https://github.com/openssl/openssl/pull/31121)

crypto/bio/bss_dgram_pair.c

index bd9b7b892c145675c51ca138ef481ef8b5caff46..d0136b4afc6a1ee820b03a612b4372ea14ec4d86 100644 (file)
@@ -305,6 +305,7 @@ static int dgram_mem_init(BIO *bio)
     b = bio->ptr;
 
     if (ring_buf_init(&b->rbuf, b->req_buf_len) == 0) {
+        dgram_pair_free(bio);
         ERR_raise(ERR_LIB_BIO, ERR_R_BIO_LIB);
         return 0;
     }