Commit ef8dae3f authored by Eric Holk's avatar Eric Holk Committed by Commit Bot

[wasm] [trap handler] do not leak memory on failure path

There were two failure paths where the CodeProtectionInfo object would not be
freed. This adds a free() on those paths to prevent a memory leak.

Bug: v8:7434
Change-Id: I48d60aee3255d829bf39b51cc30fabaf76b1fb07
Reviewed-on: https://chromium-review.googlesource.com/927746Reviewed-by: 's avatarBrad Nelson <bradnelson@chromium.org>
Commit-Queue: Eric Holk <eholk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51408}
parent d58d1fa7
......@@ -181,6 +181,7 @@ int RegisterHandlerData(
new_size = int_max;
}
if (new_size == gNumCodeObjects) {
free(data);
return kInvalidIndex;
}
......@@ -215,6 +216,7 @@ int RegisterHandlerData(
return static_cast<int>(i);
} else {
free(data);
return kInvalidIndex;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment