Like the Shaun of the Dead slogan says, "aim for the head." But before you start readying your zombie apocalypse weapon of choice, you'd better find out if you're going to get in trouble for taking out the infected. According to San Diego criminal lawyer Peter M. Liss, zombie killing won't result in murder charges; after all, while zombies were once people, they aren't technically living anymore. There are other issues you need to consider, though:
In California, it is illegal to desecrate a corpse. Again, a defense lawyer would most likely be able to fight the charges if you were acting in self defense, but if you killed the zombies when you were not in danger, you could be subject to charges. Additionally, if you used firearms to murder the walking dead, you could be arrested and charged with firing a weapon within city limits, carrying a concealed weapon and illegal possession of a firearm if you did not obtain the weapon through proper legal channels.
Most states have laws against the desecration of a corpse and firearms laws similar to those in California. Of course, if things have already reached zombie apocalypse levels of madness, you probably won't need to worry about getting busted—any cops left will be pretty concerned with killing the undead, and governments will most likely have fallen apart, so there would be no one to try you for your crimes. So go ahead, take that headshot!