Any deposit required or authorized as a condition of release may be made by the person released or by any other person. A receipt shall be issued in the name of the depositor. If the money remains on deposit at the time of a judgment for the payment of a fine, the clerk shall, under the direction of the court, if the defendant be the depositor, apply the money in satisfaction thereof, and after satisfying the fine, shall refund the surplus, if any, to the defendant. If the person to whom the receipt for the
deposit was issued was not the defendant, the deposit shall be returned to him at any time after the court has ordered such return and upon the depositor's submission of his receipt. NOTE: Section 40.40 continues the substance of former § 1297 but also authorized and provides for the disposition of a deposit made on behalf of the defendant by a third person. Compare Cal. Pen. Code §§ 1295, 1297. Return may be ordered under various circumstances. See § 40.45 (exoneration by surrender of the person released); 40.95 (order setting aside forfeiture of requiring remission); 120.18 (order following acquittal of the defendant).