Skip to content

Commit

Permalink
wasi: use free() to release preopen array
Browse files Browse the repository at this point in the history
As this is allocated with `Calloc()`, we cannot use `delete[]` here.

PR-URL: #33110
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
addaleax authored and targos committed May 7, 2020
1 parent b45c881 commit 8b7ff1c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/node_wasi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ void WASI::New(const FunctionCallbackInfo<Value>& args) {
free(options.preopens[i].real_path);
}

delete[] options.preopens;
free(options.preopens);
}
}

Expand Down

0 comments on commit 8b7ff1c

Please sign in to comment.