From a1c0e432ee605c8abaa8f34185503c2886e12545 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Thu, 14 Jun 2018 10:09:46 -0500 Subject: [PATCH] fix Timer use after free --- src/misc/timer.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/misc/timer.cpp b/src/misc/timer.cpp index a4e601e..3b48dd5 100644 --- a/src/misc/timer.cpp +++ b/src/misc/timer.cpp @@ -64,9 +64,8 @@ bool Timer::cancel(TimerCallbackPtr const &timerCallback) { TimerCallbackPtr& cur = *it; if(cur.get() == timerCallback.get()) { - queue.erase(it); cur->onList = false; - // iteration now invalid + queue.erase(it); // invalidates cur and it return true; } }