aboutsummaryrefslogtreecommitdiff
path: root/test/enginetest.c
diff options
context:
space:
mode:
authorEnji Cooper <ngie@FreeBSD.org>2026-06-09 19:06:49 +0000
committerEnji Cooper <ngie@FreeBSD.org>2026-06-09 19:06:49 +0000
commit6ecbd3d6800f1c273a5ab84088eb0d46504fd10d (patch)
tree2d3e510627a9c6b33047a6077fb4d0d2481a2361 /test/enginetest.c
parenta8688e45ec5509793681275a8631726fdeb5663a (diff)
Diffstat (limited to 'test/enginetest.c')
-rw-r--r--test/enginetest.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/test/enginetest.c b/test/enginetest.c
index 50556131b393..6132142d1e52 100644
--- a/test/enginetest.c
+++ b/test/enginetest.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2000-2026 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -61,6 +61,8 @@ static int test_engines(void)
ENGINE *new_h4 = NULL;
memset(block, 0, sizeof(block));
+ memset(eid, 0, sizeof(eid));
+ memset(ename, 0, sizeof(ename));
if (!TEST_ptr(new_h1 = ENGINE_new())
|| !TEST_true(ENGINE_set_id(new_h1, "test_id0"))
|| !TEST_true(ENGINE_set_name(new_h1, "First test item"))
@@ -171,10 +173,6 @@ cleanup_loop:
goto end;
ENGINE_free(ptr);
}
- for (loop = 0; loop < NUMTOADD; loop++) {
- OPENSSL_free(eid[loop]);
- OPENSSL_free(ename[loop]);
- }
to_return = 1;
end:
@@ -182,8 +180,11 @@ end:
ENGINE_free(new_h2);
ENGINE_free(new_h3);
ENGINE_free(new_h4);
- for (loop = 0; loop < NUMTOADD; loop++)
+ for (loop = 0; loop < NUMTOADD; loop++) {
+ OPENSSL_free(eid[loop]);
+ OPENSSL_free(ename[loop]);
ENGINE_free(block[loop]);
+ }
return to_return;
}