getPeer() had a small potential to be unsafe.
This commit is contained in:
parent
f974517f64
commit
377ccff600
2 changed files with 22 additions and 18 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue