Merge pull request #15776 from ukernel/wip-20338

osdc/Journaler: fix memory leak in Journaler::_issue_read()

Reviewed-by: John Spray <john.spray@redhat.com>
This commit is contained in:
John Spray 2017-06-22 07:07:21 -04:00 committed by GitHub
commit 1e917eb8d6

View File

@ -526,11 +526,16 @@ void Journaler::_finish_flush(int r, uint64_t start, ceph::real_time stamp)
<< dendl;
// kick waiters <= safe_pos
if (!waitfor_safe.empty()) {
list<Context*> ls;
while (!waitfor_safe.empty()) {
if (waitfor_safe.begin()->first > safe_pos)
auto it = waitfor_safe.begin();
if (it->first > safe_pos)
break;
finish_contexts(cct, waitfor_safe.begin()->second);
waitfor_safe.erase(waitfor_safe.begin());
ls.splice(ls.end(), it->second);
waitfor_safe.erase(it);
}
finish_contexts(cct, ls);
}
}