Penal Code Section 106
Right of private defence against a deadly assault when there is risk of harm to an innocent person
106. If, in the exercise of the right of private defence against an assault which reasonably causes the apprehension of death, the defender is so situated that he cannot effectually exercise that right without risk of harm to an innocent person, his right of private defence extends to the running of that risk.
A is attacked by a mob who attempt to murder him. He cannot effectually exercise his right of private defence without firing on the mob, and he cannot fire without risk of harming young children who are mingled with the mob. A commits no offence if by so firing he harms any of the children.
Please refer to the Attorney General's Chamber of Malaysia's website for the latest law.