You can also introduce a new block:
```
{
  Mutex::Locker(pinger->lock);
}
```
But while you need to deal with this specific instance leaking on the return, you need to refactor the function to avoid this class of errors one way or another.