The court to whom the petition is addressed shall hear the application, and may, on examination thereof, in its discretion, make an order requiring the principal in such bond to give a new bond, with sureties for the performance of his official duties.