getPeer() had a small potential to be unsafe.

This commit is contained in:
Adam Ierymenko 2015-10-30 13:39:28 -07:00
parent f974517f64
commit 377ccff600
2 changed files with 22 additions and 18 deletions

View file

@ -87,7 +87,7 @@ public:
inline SharedPtr<Peer> getPeerNoCache(const Address &zta,const uint64_t now)
{
Mutex::Lock _l(_lock);
const SharedPtr<Peer> *ap = _peers.get(zta);
const SharedPtr<Peer> *const ap = _peers.get(zta);
if (ap) {
(*ap)->use(now);
return *ap;