A National Guardsman stationed at San Francisco International Airport to protect against terrorist attacks accidentally shot himself in the hip last week while trying to remove a pistol from his holster, officials said Wednesday.