diff --git a/crates/c-api/src/val.rs b/crates/c-api/src/val.rs index 243df313f3..4c7777dd13 100644 --- a/crates/c-api/src/val.rs +++ b/crates/c-api/src/val.rs @@ -25,7 +25,7 @@ pub union wasm_val_union { impl Drop for wasm_val_t { fn drop(&mut self) { match into_valtype(self.kind) { - ValType::ExternRef => unsafe { + ValType::FuncRef | ValType::ExternRef => unsafe { if !self.of.ref_.is_null() { drop(Box::from_raw(self.of.ref_)); }