From 105c3d4fb0e213f9ad5330e15fd484d1f5d16433 Mon Sep 17 00:00:00 2001 From: Vera Xia Date: Wed, 21 Feb 2024 12:28:31 -0800 Subject: [PATCH] Fix Memory leak caused by redefinition (#626) --- source/darwin/darwin_pki_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/darwin/darwin_pki_utils.c b/source/darwin/darwin_pki_utils.c index 479932d11..20fcb82e0 100644 --- a/source/darwin/darwin_pki_utils.c +++ b/source/darwin/darwin_pki_utils.c @@ -223,7 +223,7 @@ int aws_import_public_and_private_keys_to_identity( struct aws_pem_object *root_cert_ptr = NULL; aws_array_list_get_at_ptr(&cert_chain_list, (void **)&root_cert_ptr, 0); AWS_ASSERT(root_cert_ptr); - CFDataRef root_cert_data = CFDataCreate(cf_alloc, root_cert_ptr->data.buffer, root_cert_ptr->data.len); + root_cert_data = CFDataCreate(cf_alloc, root_cert_ptr->data.buffer, root_cert_ptr->data.len); if (!root_cert_data) { AWS_LOGF_ERROR(AWS_LS_IO_PKI, "static: failed creating root cert data."); result = aws_raise_error(AWS_ERROR_SYS_CALL_FAILURE);