Skip to content

Commit

Permalink
Merge pull request #3581 from wasmerio/fix_capi_memory_leak
Browse files Browse the repository at this point in the history
Fix WASI example that initialized wasi_config 2 times
  • Loading branch information
Michael Bryan authored Feb 21, 2023
2 parents abd03ec + 0a2137f commit 8de6b30
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions lib/c-api/examples/wasi.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,6 @@ int main(int argc, const char* argv[]) {

wasm_byte_vec_delete(&binary);

printf("Setting up WASI...\n");
config = wasi_config_new("example_program");
// TODO: error checking
js_string = "function greet(name) { return JSON.stringify('Hello, ' + name); }; print(greet('World'));";
wasi_config_arg(config, "--eval");
wasi_config_arg(config, js_string);
wasi_config_capture_stdout(config);

wasi_env_t* wasi_env = wasi_env_new(store, config);

if (!wasi_env) {
Expand Down

0 comments on commit 8de6b30

Please sign in to comment.