### Godot version

master CI builds

### System information

Linux / Editor with doubles and GCC sanitizers

### Issue description

The `Linux / Editor with doubles and GCC sanitizers` build can fail with a `attempting free on address which was not malloc()-ed` crash in the `Open and close editor (Vulkan)` step.

https://github.com/godotengine/godot/actions/runs/5366302204/jobs/9735786296#step:15:138
https://github.com/godotengine/godot/actions/runs/5389199469/jobs/9783070708?pr=78740#step:15:138

The failure doesn't seem related to either PR (in fact one of them is just a docs change). I have only seen this issue these two times, still probably worth looking into.

### Steps to reproduce

Open and close https://github.com/godotengine/regression-test-project/archive/4.0.zip using the Vulkan renderer.

### Minimal reproduction project

https://github.com/godotengine/regression-test-project/archive/4.0.zip
if (is_device_extension_enabled(VK_KHR_CREATE_RENDERPASS_2_EXTENSION_NAME)) {
		if (fpCreateRenderPass2KHR == nullptr) {
			fpCreateRenderPass2KHR = (PFN_vkCreateRenderPass2KHR)vkGetDeviceProcAddr(p_device, "vkCreateRenderPass2KHR");
		}
		if (fpCreateRenderPass2KHR == nullptr) {
			return VK_ERROR_EXTENSION_NOT_PRESENT;
		} else {
			return (fpCreateRenderPass2KHR)(p_device, p_create_info, p_allocator, p_render_pass);
		}
	} else {
		
		const void *next = p_create_info->pNext; 
		Vector<VkAttachmentDescription> attachments;
		for (uint32_t i = 0; i < p_create_info->attachmentCount; i++) {
			
			VkAttachmentDescription att = {
				p_create_info->pAttachments[i].flags, 
				p_create_info->pAttachments[i].format, 
				p_create_info->pAttachments[i].samples, 
				p_create_info->pAttachments[i].loadOp, 
				p_create_info->pAttachments[i].storeOp, 
				p_create_info->pAttachments[i].stencilLoadOp, 
				p_create_info->pAttachments[i].stencilStoreOp, 
				p_create_info->pAttachments[i].initialLayout, 
				p_create_info->pAttachments[i].finalLayout 
			};
			attachments.push_back(att);
		}