Malaria causing parasites (Plasmodium) usually infect red blood cells and replicate there. We know that deficiency of glucose 6 phosphate dehydrogenase causes hemolysis, in which red blood cells get damaged. As a result there remain very few RBCs. Thus malarial parasites hardly get any RBCs to infect. Due to this reason a person having deficiency of G-6PD cannot gets affected by malaria.