Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Unified Diff: src/wasm/wasm-module.cc

Issue 2476643003: [wasm] Fix a memory leak in test-run-wasm-module. (Closed)
Patch Set: Rebase Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/cctest/wasm/test-run-wasm-module.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/wasm-module.cc
diff --git a/src/wasm/wasm-module.cc b/src/wasm/wasm-module.cc
index 85b606e79b3cd6dd46ffde7787e24bde6b4d0450..fe6fb60dce3a188445d75e8461237de8807abe75 100644
--- a/src/wasm/wasm-module.cc
+++ b/src/wasm/wasm-module.cc
@@ -2065,12 +2065,12 @@ bool wasm::ValidateModuleBytes(Isolate* isolate, const byte* start,
const byte* end, ErrorThrower* thrower,
ModuleOrigin origin) {
ModuleResult result = DecodeWasmModule(isolate, start, end, false, origin);
- if (result.ok()) {
- DCHECK_NOT_NULL(result.val);
+ if (result.val) {
delete result.val;
- return true;
+ } else {
+ DCHECK(!result.ok());
}
- return false;
+ return result.ok();
}
MaybeHandle<JSArrayBuffer> wasm::GetInstanceMemory(Isolate* isolate,
« no previous file with comments | « no previous file | test/cctest/wasm/test-run-wasm-module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698