I'm not sure what's going on here, so I'll just post the warning that came from Visual Studio code analysis:
C6001 Using uninitialized memory 'r'. 496 'r' is not initialized 497 '*r' is used, but may not have been initialized