PVS-Studio’s challenge: can you spot an error?

Code analyzers can easily find not-so-obvious errors. Want to compete? Try to beat PVS-Studio!

We chose 10 code fragments where the analyzer found errors. These fragments are from well-known open-source projects. If you can find an error in under 60 seconds, you score 1 point. The code fragments are small, so 60 seconds is a fair limit.

Good luck!