I've started a war with vassal, so his liege joined. I Captured city of the second one, but few turns later he somehow left the war and stopped being liege. Now I've ended war with former vassal and captured city is still occupied.