I should preface this with the caveat that the story of what happened during the rise and fall of 'IS'/Daesh is still being written, and that we can reasonably expect many more details to become available in the future.
It is also worth repeating the old truism that "absence of evidence is not evidence of absence". There may have been undocumented atrocities carried out, and these would simply never make the news or the historical record. What follows is based on the published evidence that I found online.
It seems, from what was reported in the media, that they simply released the prisoners held in jails in territory that they overran.
Although there are plenty of stories of torture and executions by 'IS'/Daesh after they overran towns in Iraq and Syria, none of these appear to involve prisoners that had been released by the group.
The reasons behind this may be explained in a 2014 article titled The Great Iraqi Jail Break on foreignpolicy.com. The article reports that the leader of 'IS'/Daesh, Abu Du’a (a.k.a. Abu Bakr al-Baghdadi), actually announced that releasing Muslim prisoners was his group’s most important mission.
In an audio statement entitled "Destroying the Gates", released in July 2012, he is reported to have said:
"We remind you of your top priority, which is to release the Muslim prisoners everywhere, and making the pursuit, chase, and killing of their butchers from amongst the judges, detectives, and guards to be on top of the list."
It is fairly easy to find media stories about prisoners being released after the group overran the Iraqi cities of Tikrit and Mosul in 2014. If that coverage is accurate, it would appear that many of the prisoners that were released were also militants from other groups like al Qaeda. Presumably, these individuals went on to join the group. However, there is no mention of any action taken against other prisoners.
I've included a few examples of stories that seem to be fairly representative.
The article reports that
... the insurgents have captured two prisons and freed 1,200 prisoners, many of them Isis fighters
But makes no mention of any actions taken against prisoners by Daesh.
This states that 2,500 prisoners were released when the group overran Mosul. It seems this total includes prisoners released from other prisons from the region, which illustrates some of the problems in getting accurate details about what actually happened.
Reports that 300 prisoners were released in Tikrit.
Note that none of these reports mention any actions taken by the group against any of the prisoners that they had released.
On the other hand. there are no shortage of stories about executions of other groups and individuals captured by 'IS'/Daesh. These were usually carried out in public and often well publicised by the group. One example here would be the execution of between 560 and 1,700 prisoners who were captured when the group overran Camp Speicher (Daesh claimed to have executed 1,700; an investigation by Human Rights Watch found the number to have been "at least between 560 and 770").
By comparison, the stories of executions of former prisoners released by 'IS'/Daesh are conspicuous by their absence.