diff options
author | Ben Smith <binjimin@gmail.com> | 2017-03-06 11:34:37 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-06 11:34:37 -0800 |
commit | e4dda12b17a5323a56b6782a6787f258ed2d8c81 (patch) | |
tree | c47e34928fc9b48f5b8dd1579e4c0213074b6494 /src/tools/wasmopcodecnt.cc | |
parent | b6e5735f3bfbb66d76142fc2f404da796289fc76 (diff) | |
download | wabt-e4dda12b17a5323a56b6782a6787f258ed2d8c81.tar.gz wabt-e4dda12b17a5323a56b6782a6787f258ed2d8c81.tar.bz2 wabt-e4dda12b17a5323a56b6782a6787f258ed2d8c81.zip |
Use new/delete instead of malloc/free (#332)
Also switch some void* -> char*, because it removes some unnecessary
casts. C++ does not like void*.
Diffstat (limited to 'src/tools/wasmopcodecnt.cc')
-rw-r--r-- | src/tools/wasmopcodecnt.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tools/wasmopcodecnt.cc b/src/tools/wasmopcodecnt.cc index 991b3302..4f09a958 100644 --- a/src/tools/wasmopcodecnt.cc +++ b/src/tools/wasmopcodecnt.cc @@ -334,13 +334,13 @@ int main(int argc, char** argv) { init_stdio(); parse_options(argc, argv); - void* data; + char* data; size_t size; Result result = read_file(s_infile, &data, &size); if (WABT_FAILED(result)) { const char* input_name = s_infile ? s_infile : "stdin"; ERROR("Unable to parse: %s", input_name); - wabt_free(data); + delete[] data; } FILE* out = stdout; if (s_outfile) { @@ -378,6 +378,6 @@ int main(int argc, char** argv) { } destroy_opcnt_data(&opcnt_data); } - wabt_free(data); + delete[] data; return result != Result::Ok; } |