]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
test/testutil/main.c: move global_init before test_open_streams
authorEugene Syromiatnikov <esyr@openssl.org>
Wed, 30 Jul 2025 14:54:09 +0000 (16:54 +0200)
committerNeil Horman <nhorman@openssl.org>
Fri, 8 Aug 2025 16:22:10 +0000 (12:22 -0400)
So it is possible to change the allocator implementation,
as it must be before the first malloc call.

Suggested-by: Matt Caswell <matt@openssl.org>
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28059)

test/testutil/main.c

index 32e32d8328723ba1e0fb7cb4b15defa47035c9f4..c94efed25f9b9776a394720637854dbcbd7fb9fa 100644 (file)
@@ -16,10 +16,13 @@ int main(int argc, char *argv[])
 {
     int ret = EXIT_FAILURE;
     int setup_res;
+    int gi_ret;
+
+    gi_ret = global_init();
 
     test_open_streams();
 
-    if (!global_init()) {
+    if (!gi_ret) {
         test_printf_stderr("Global init failed - aborting\n");
         return ret;
     }