The US addressed this issue in the early years of the Korean War, we left (And supported) the Government of South Korea in their execution of prisoners being held for being communists. The North Koreans did the same as their retreated, through this was of American POWs (many such POWs were found after being shot, bit propaganda blitz on this in the US at that time, while forgetting about the fact the South Korean Government had done the same eariler in the war).
Further back in History, King Henry V of England started to kill his French Prisoners just before he won the Battle of Agincourt (On the grounds Henry did NOT want them to rejoin the French Army he was fighting).
In fact one of the few arguments in favor of the Death Penalty is situation where Life Imprisonment of a traitor who had murder someone in an attempt to take over a government can NOT be guarantee on the grounds that the people who support the same side as such a Murder can also get in power and release such a Murder. Yes, the US Federal Government has NEVER sentenced anyone to Death for Treason (John Brown after his attack on Harper's Ferry was convicted in STATE Court of Treason and executed, the Rosenbergs of the 1950s were executed for Espionage NOT Treason).
Sorry, what do you do with such prisoners? You do NOT want to them to reinforce the enemy you are fighting, but you can no longer hold them to prevent them from doing so. The smart plan is just to release them, as unorganized members of the opposition such people tend to be ineffective in the first place, but such thinking require someone who is thinking not just reacting to what is happening around him. In most cases the people in charge are facing something that can be reduced to a bad choice, release the prisoners, which the Guards have been ordered NEVER TO DO, to kill them, which the Guards have been told to do IF THE PRISONERS TRY TO ESCAPE. The prisoners being freed by someone else is NOT is the guards training and people tend to do as their are trained, and the closing thing to the prisoners being freed by outside forces, is the prisoners escaping and the training the Guards have is to STOP such prison escapes even if that means they have to shoot the prisoners. Thus in almost all cases such prisoners are Executed.
Please note, there are some notable exceptions to this rule, during the US Civil War, as Sherman was marching through Georgia, one of the Local Southern POWs camp was in the area of Sherman's troops. The Commander of the POW camp paroled the POWs and told them to go see Sherman.
Another example is of the Japanese Commander of Santo Tomas POW camp in the Philippines (where American Nurses were also being kept as POWs) when American troops came to the Camp, made an offer to the American Forces arriving at the camp, if the Americans would leave him get to Japanese lines, he would turn the POWs over to the Americans, otherwise he was going to kill them. The offer was accepted and the Japanese marched out of the Camp as the American marched in. The Former POWs were then sent home (The prison guards were NOT so lucky, most were killed within hours of leaving the POW camp).
This are notable exceptions to the rule of killing prisoners. The norm is what South Korea did to its Communist Prisoners in the early days of the Koran War, what the North Koreans did as they retreated northward after the American landing at Inchon, and what Henry V did at Agincourt. It is an old practice and one it takes someone who is thinking to do, not someone who is reacting to events as is the norm in most such killings.
The Incident in regards to the Japanese POW Camp is to the release of the Santo Tomas Camp.
http://gawler.homestead.com/RescueCamp.htmlCamp Florence, the camp closed down by the Confederacy and the Prisoner paroled to the North as Sherman marched through Georgia:
http://www.civilwar.n2genealogy.com/pow/sc-florence.html