From 8d95e637f2b19235fa40255516b9f049da0fcb63 Mon Sep 17 00:00:00 2001 From: Mark McCaskey Date: Fri, 1 Nov 2019 17:38:43 -0700 Subject: [PATCH] Add probable fix of memory leak in trampoline code --- lib/runtime-c-api/src/trampoline.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/runtime-c-api/src/trampoline.rs b/lib/runtime-c-api/src/trampoline.rs index 923622aa509..ed7b8971bf0 100644 --- a/lib/runtime-c-api/src/trampoline.rs +++ b/lib/runtime-c-api/src/trampoline.rs @@ -61,7 +61,7 @@ pub unsafe extern "C" fn wasmer_trampoline_buffer_builder_build( #[allow(clippy::cast_ptr_alignment)] pub unsafe extern "C" fn wasmer_trampoline_buffer_destroy(buffer: *mut wasmer_trampoline_buffer_t) { if !buffer.is_null() { - Box::from_raw(buffer); + Box::from_raw(buffer as *mut TrampolineBuffer); } }