]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
test/quic_multistream_test.c: Add OPENSSL_free() to avoid memory leak
authorJiasheng Jiang <jiashengjiangcool@gmail.com>
Thu, 26 Jun 2025 19:07:39 +0000 (19:07 +0000)
committerTomas Mraz <tomas@openssl.org>
Tue, 1 Jul 2025 18:49:02 +0000 (20:49 +0200)
Add OPENSSL_free() to free bdata if an error occurs to avoid memory leak.

Fixes: a55b689499 ("Use reported short conn id len in qtestlib")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27914)

test/quic_multistream_test.c

index bd3835e754cd8aa57c921222ff887ec55818ced2..ccac6e169c20655cc7b5e432e6a894ea3496af95 100644 (file)
@@ -780,6 +780,7 @@ static int helper_init(struct helper *h, const char *script_name,
             goto err;
         bdata->fault = h->qtf;
         BIO_set_data(h->s_qtf_wbio, bdata);
+        bdata = NULL;
     }
 
     h->s_net_bio_own = NULL;
@@ -855,6 +856,7 @@ static int helper_init(struct helper *h, const char *script_name,
     return 1;
 
 err:
+    OPENSSL_free(bdata);
     helper_cleanup(h);
     return 0;
 }