Merge pull request #4211 from sfc-gh-anoyes/anoyes/fix-memory-error
Fix heap use after free
This commit is contained in:
commit
297b9cc7dd
|
@ -316,12 +316,12 @@ public:
|
|||
|
||||
class CurrentRunningFetchKeys {
|
||||
std::unordered_map<UID, double> startTimeMap;
|
||||
std::unordered_map<UID, KeyRangeRef> keyRangeMap;
|
||||
std::unordered_map<UID, KeyRange> keyRangeMap;
|
||||
|
||||
static const StringRef emptyString;
|
||||
static const KeyRangeRef emptyKeyRange;
|
||||
public:
|
||||
void recordStart(const UID id, const KeyRange keyRange) {
|
||||
void recordStart(const UID id, const KeyRange& keyRange) {
|
||||
startTimeMap[id] = now();
|
||||
keyRangeMap[id] = keyRange;
|
||||
}
|
||||
|
@ -331,7 +331,7 @@ public:
|
|||
keyRangeMap.erase(id);
|
||||
}
|
||||
|
||||
std::pair<double, KeyRangeRef> longestTime() const {
|
||||
std::pair<double, KeyRange> longestTime() const {
|
||||
if (numRunning() == 0) {
|
||||
return {-1, emptyKeyRange};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue