In proceedings in any court for the sale of real estate by a fiduciary when a person is entitled to a right or estate of dower or curtesy in the premises, or any part or share thereof, the court may, having regard to the interests of all persons concerned, determine whether such right or estate shall be excepted from the sale of the premises or sold therewith, and enter its judgment or order accordingly.
If the sale of the premises including such right or estate is ordered, the estate and interest of every such person shall pass thereby, and the purchaser, his heirs and assigns shall hold the premises free and discharged from all claims by virtue thereof.
N.J.S. § 3A:16-16