A man who has been in pretrial custody for eight months in a drug case has been released from prison for a second time.