diff --git a/plugin/rt/src/lib.rs b/plugin/rt/src/lib.rs index f010266708..bf7d4cdd09 100644 --- a/plugin/rt/src/lib.rs +++ b/plugin/rt/src/lib.rs @@ -44,6 +44,6 @@ static mut BUFFERS: Vec = Vec::new(); /// This function should never be used only intented to by used by the host #[no_mangle] pub unsafe fn wasm_prepare_buffer(size: i32) -> i32 { - BUFFERS = Vec::::with_capacity(size as usize); + BUFFERS = vec![0u8; size as usize]; BUFFERS.as_ptr() as i32 }