Umair, the freed slave of Abu’l-Lahm, said: When I was present at (the battle of) Khaybar, at that time I was a slave (of my master). So the Messenger of Allah, peace and blessings be upon him, gave me a sword from the household belongings and said: "Hang it (by your side)."
From this hadith, it is understood that slaves have no share in the spoils of war (mal-e-ghanīmah). However, as a reward, something may be given to them, just as the Messenger of Allah (sallallahu alayhi wa sallam) granted a sword to Umair. Similarly, children and women also have no share in the spoils of war; something may be given to them as a reward. This is the position of the majority of scholars and the Ahl al-Hadith, as is explained in Abu Dawud. And Allah knows best.