Skip to content

Commit

Permalink
Fix use-after-free in reboot_notifications_scheduler
Browse files Browse the repository at this point in the history
Reset observation in RebootNotificationsScheduler destructor.

Bug: 1318791
Change-Id: Ib91be604b380e952de55adbf386eb45cfebb7a96
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3784792
Commit-Queue: Sanja Perisic <sanjaperisic@chromium.org>
Reviewed-by: Anqing Zhao <anqing@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1028200}
  • Loading branch information
Sanja Perisic authored and Chromium LUCI CQ committed Jul 26, 2022
1 parent a49273f commit 56df737
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ RebootNotificationsScheduler::RebootNotificationsScheduler(

RebootNotificationsScheduler::~RebootNotificationsScheduler() {
DCHECK_EQ(instance, this);
observation_.Reset();
RebootNotificationsScheduler::SetInstance(nullptr);
}

Expand Down

0 comments on commit 56df737

Please sign in to comment.