If any person attests the execution of any will to whom or to whose wife or husband any beneficial devise, legacy, estate, interest, gift or appointment of or affecting any property, other than and except charges and directions for the payment of any debt or debts, shall be thereby given or made, such device, legacy, estate, interest, gift or appointment shall, so far only as concerns such person attesting the execution of such will, or the wife or husband of such person, or any person claiming under such person or wife or husband, be utterly null and void, and such person so attesting shall be admitted as a witness to prove the execution or to prove the validity or invalidity thereof, notwithstanding such devise, legacy, interest, gift of appointment mentioned in such will.
Source: Section 9 of Wills Act 1959
In plain words
If someone who signs your Will as a witness (or their husband or wife) is also left a gift in it, that gift is cancelled. The rest of the Will still stands, and the witness can still prove it was signed properly. To avoid this, use two witnesses who receive nothing under the Will. Debts you ask the estate to pay to a witness are not affected.
Legal basis and further reading
General information for Malaysia, not legal advice. For your own situation, speak to a lawyer.