mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-10 18:05:44 +02:00
fix: Invalid memory access (#2435)
The (subtle) bug is that the previous code uses an `initializer_list` c'tor, which copies the `string_view` locally. Then it keeps that reference to the `string_view`, but it goes out of scope in the next line
This commit is contained in:
parent
d1db48d9d4
commit
b66db852f9
1 changed files with 1 additions and 1 deletions
|
@ -195,7 +195,7 @@ unsigned PrimeEvictionPolicy::Evict(const PrimeTable::HotspotBuckets& eb, PrimeT
|
|||
|
||||
// log the evicted keys to journal.
|
||||
if (auto journal = db_slice_->shard_owner()->journal(); journal) {
|
||||
ArgSlice delete_args{key};
|
||||
ArgSlice delete_args(&key, 1);
|
||||
journal->RecordEntry(0, journal::Op::EXPIRED, cntx_.db_index, 1, ClusterConfig::KeySlot(key),
|
||||
make_pair("DEL", delete_args), false);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue