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 <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
addaleax authored and targos committed May 4, 2020
1 parent f61928b commit 3866dc1
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 @@ -236,7 +236,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 3866dc1

Please sign in to comment.