double-check your damn pointers, okay?

Yesterday, working on my thesis, I felt like I died and resurrected more than once in a few hours. Trust me, I’m beginning to understand the way the compiler feels
Jokes apart, the following C++ code contains a bug similar to the one I found: can you spot it? (please forgive the bad indent [...]