diff options
Diffstat (limited to 'test/enginetest.c')
| -rw-r--r-- | test/enginetest.c | 13 |
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; } |
