Fix a use after free. RI is freed before the call to getDebugLoc(). To