Hi Shnita,
The child is probably having ear wax, which gives a foul odor when it becomes soft. Otomycosis is another cause for the foul smelling discharge but if present, will be painful, so it is ruled out. Please do get the ear examined from the ENT specialist.
Regards
OHNS2010
I would recommend consulting an ENT Specialist and visually checking the ear canal ASAP.