Why was Saif al-Islam Gaddafi released from prison?

The son of Libya’s former leader Muammar Gaddafi has been released from prison.