The court heard that James Allen told a friend that he was dying of cancer on the night of one of the murders.
A friend of James Allen said that he took pity on him, and offered him somewhere to stay the night.
Allen is accused of murdering a pensioner in Middlesbrough last April, as well as a woman in Whitby.
The trial continues.
More top news
Seven people have been arrested on suspicion of manslaughter after a man died following an incident at nightclub in Durham.
Emma Jesson brings you Saturday night's forecast
Sandiford, a former legal secretary originally from Redcar, was convicted of drug smuggling offences and sentenced to death in 2013.