Uninitialized variables: error when passing uninit pointer to function