fix: avoid contextBridge double free on garbage collection (#21592)

* fix: reset next/prev pointers for life-monitored nodes

* fix: don't double-delete nodes in a linked list
This commit is contained in:
loc 2020-01-10 15:59:50 -08:00 committed by Samuel Attard
parent 2858471151
commit 301bd8aec0

View file

@ -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
@ -76,11 +78,7 @@ WeakGlobalPairNode::WeakGlobalPairNode(WeakGlobalPair pair) {
this->pair = std::move(pair);
}
WeakGlobalPairNode::~WeakGlobalPairNode() {
if (next) {
delete next;
}
}
WeakGlobalPairNode::~WeakGlobalPairNode() {}
RenderFramePersistenceStore::RenderFramePersistenceStore(
content::RenderFrame* render_frame)