The 2 codes and their diagnosis are covered
here. Even a flow chart, systems visual etc.
Yes, it is usually a leak, mine was but since I started out thinking MAF, I had to go down the how do you detect, diagnose etc trail.
O2 sensor failures are usually quite specific and indicated by other codes.