Failure to calloc in bin2hex is a fatal failure always so just check for that failure within the function and abort, simplifying the rest of the code.