If you are allocating data to the pointers later, you don't have to set the pointers to null (although you're right that it is better). If just making that change stopped the bug, then the real bug is probably somewhere else in your code (like something using a pointer it assumes has already been assigned a valid value to).