Skip to content

Commit

Permalink
chore: free mock input in extism memory
Browse files Browse the repository at this point in the history
  • Loading branch information
zshipko committed May 20, 2024
1 parent 2984173 commit 87cc1d4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ pub fn mock_input<T: FromBytesOwned>() -> Result<T> {
None => anyhow::bail!("Error fetching mock input: invalid output offset"),
Some(x) => x,
};
output.to()
let x = output.to();
output.free();
x
}

/// Call a function from the Extism plugin being tested, passing input and returning its output Memory.
Expand Down

0 comments on commit 87cc1d4

Please sign in to comment.