Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: avoid contextBridge double free on garbage collection #21592

Merged
merged 2 commits into from Jan 10, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -47,9 +47,11 @@ class CachedProxyLifeMonitor final : public ObjectLifeMonitor {
}
if (node_->prev) {
node_->prev->next = node_->next;
node_->prev = nullptr;
}
if (node_->next) {
node_->next->prev = node_->prev;
node_->next = nullptr;
}
if (!node_->prev && !node_->next) {
// Must be a single length linked list
Expand All @@ -76,11 +78,7 @@ WeakGlobalPairNode::WeakGlobalPairNode(WeakGlobalPair pair) {
this->pair = std::move(pair);
}

WeakGlobalPairNode::~WeakGlobalPairNode() {
if (next) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how... was this ever sensible?

cc @MarshallOfSound

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think past me reasoned that deleting the head of a list should delete everything in the list without thinking about how this particular linked list was being used

delete next;
}
}
WeakGlobalPairNode::~WeakGlobalPairNode() {}

RenderFramePersistenceStore::RenderFramePersistenceStore(
content::RenderFrame* render_frame)
Expand Down