diff options
| author | Yuqian Yang <crupest@crupest.life> | 2025-11-03 19:16:25 +0800 |
|---|---|---|
| committer | Yuqian Yang <crupest@crupest.life> | 2025-11-03 19:16:25 +0800 |
| commit | d740f0b4d21d1ae45e9d17b70d9cdc82bda709c7 (patch) | |
| tree | deb9f9d01dd7c6c3e154f2d4715bb54e6089c98e | |
| parent | 1e1ccbff5cc4f4ec7d870ea1db985b08e37ed3f8 (diff) | |
| download | cru-d740f0b4d21d1ae45e9d17b70d9cdc82bda709c7.tar.gz cru-d740f0b4d21d1ae45e9d17b70d9cdc82bda709c7.tar.bz2 cru-d740f0b4d21d1ae45e9d17b70d9cdc82bda709c7.zip | |
Fix a use after free.
| -rw-r--r-- | include/cru/base/Timer.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/cru/base/Timer.h b/include/cru/base/Timer.h index dac66c6a..6e34d9cb 100644 --- a/include/cru/base/Timer.h +++ b/include/cru/base/Timer.h @@ -106,9 +106,9 @@ class TimerRegistry : public Object2 { if (timer.repeat) { return UpdateResult{timer.id, timer.data}; } else { - D data(std::move(timer.data)); + UpdateResult result{timer.id, std::move(timer.data)}; timers_.erase(iter); // We will return, so it's safe to erase here. - return UpdateResult{timer.id, std::move(data)}; + return result; } } } |
