Commit 8ee58cad2f for openssl.org

commit 8ee58cad2f487088ba150ed012fe8a78725b3f24
Author: Jakub Zelenka <jakub.zelenka@openssl.foundation>
Date:   Fri May 8 16:42:01 2026 +0200

    Add mfail test for new BIO dgram mem

    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:16 2026
    (Merged from https://github.com/openssl/openssl/pull/31121)

diff --git a/test/bio_dgram_test.c b/test/bio_dgram_test.c
index 23b47b3adb..fab840537c 100644
--- a/test/bio_dgram_test.c
+++ b/test/bio_dgram_test.c
@@ -776,6 +776,22 @@ err:
     return testresult;
 }
 #endif /* !defined(OPENSSL_NO_CHACHA) */
+
+static int test_bio_dgram_mfail(void)
+{
+    BIO *bio;
+
+    MFAIL_start();
+    bio = BIO_new(BIO_s_dgram_mem());
+    MFAIL_end();
+
+    if (bio == NULL)
+        return 0;
+
+    BIO_free(bio);
+    return 1;
+}
+
 #endif /* !defined(OPENSSL_NO_DGRAM) && !defined(OPENSSL_NO_SOCK) */

 int setup_tests(void)
@@ -790,6 +806,7 @@ int setup_tests(void)
 #if !defined(OPENSSL_NO_CHACHA)
     ADD_ALL_TESTS(test_bio_dgram_pair, 3);
 #endif
+    ADD_MFAIL_TEST(test_bio_dgram_mfail);
 #endif

     return 1;