When any person has an interest in the detention, the prisoner shall not be discharged until the person having such interest is notified.
R.L. 1910, § 4896.