hr should probably be initialize to failure to avoid paths leading to uninitialized variable.
CID 1322231