From fa35be5859530b88042c0192d3f4813a5c973e4e Mon Sep 17 00:00:00 2001 From: Frank Morgner Date: Mon, 4 Nov 2019 14:39:08 +0100 Subject: [PATCH] fixed 347857 Resource leak --- src/tests/p11test/p11test_case_common.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tests/p11test/p11test_case_common.c b/src/tests/p11test/p11test_case_common.c index 77285af7..bd4b39af 100644 --- a/src/tests/p11test/p11test_case_common.c +++ b/src/tests/p11test/p11test_case_common.c @@ -458,6 +458,7 @@ int search_objects(test_certs_t *objects, token_info_t *info, if (rv != CKR_OK) { fprintf(stderr, "C_FindObjectsFinal: rv = 0x%.8lX\n", rv); fail_msg("Could not find certificate.\n"); + free(object_handles); return -1; } @@ -475,6 +476,7 @@ int search_objects(test_certs_t *objects, token_info_t *info, continue; } else if (rv != CKR_OK) { fail_msg("C_GetAttributeValue: rv = 0x%.8lX\n", rv); + free(object_handles); return -1; } @@ -485,6 +487,7 @@ int search_objects(test_certs_t *objects, token_info_t *info, template[j].pValue = malloc(template[j].ulValueLen); if (template[j].pValue == NULL) { fail_msg("malloc failed"); + free(object_handles); return -1; } } @@ -493,6 +496,7 @@ int search_objects(test_certs_t *objects, token_info_t *info, &(template[j]), 1); if (rv != CKR_OK) { fail_msg("C_GetAttributeValue: rv = 0x%.8lX\n", rv); + free(object_handles); return -1; } }