Yep, you're probably right! The code logic is pretty fuzzy I should have assumed such scenario. Pointer initialization should do the job.