Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
wasi: use free() to release preopen array
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 13, 2020
1 parent b3f0417 commit 843a54f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/node_wasi.cc
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 843a54f

Please sign in to comment.