Hi all,
Our code scanner has reported a double free at wasm-opcodecnt.cc#L221,
There are two delete[] data inside function ProgramMain, if read_file failed, it could occur some unexpected behaviors.
May be we can add a return statement after the first delete to avoid this?
char* data;
size_t size;
Result result = read_file(s_infile, &data, &size);
if (Failed(result)) {
const char* input_name = s_infile ? s_infile : "stdin";
ERROR("Unable to parse: %s", input_name);
delete[] data; // <===
}
if (Succeeded(result)) {
....
}
delete[] data; // <====
return result != Result::Ok;
SourceBrella Inc.
Alex