Sunan an-Nasa'i 4056
It was narrated that Jarir said:
"Any slave who runs away from his masters and joins the enemy, he has made it permissible to shed his blood."
أَخْبَرَنَا عَلِيُّ بْنُ حُجْرٍ، قَالَ حَدَّثَنَا شَرِيكٌ، عَنْ أَبِي إِسْحَاقَ، عَنْ عَامِرٍ، عَنْ جَرِيرٍ، قَالَ أَيُّمَا عَبْدٍ أَبَقَ مِنْ مَوَالِيهِ وَلَحِقَ بِالْعَدُوِّ فَقَدْ أَحَلَّ بِنَفْسِهِ ‏.‏