If the judge or clerk allows the bail as sufficient, he shall annex the examination to the undertaking, indorse his allowance thereon, and cause them to be filed with the clerk of the court in which the action is pending. The marshal shall thereupon be exonerated from liability.