Dying lawyer convicted of aiding terrorism leaves prison