Thomas Hobbes claims that "where no civil law is, there is no crime," (Leviathan, Part II, Ch. 27). These circumstances existed when the state of nature was the state of war. Killing is in fact a "right of nature" for Hobbes, who imagined a primordial lawless society in which people had a right to seek only their own advantage, and wherein no bonds of trust were acknowledged or enforced. We surrender these rights, according to Hobbes, in recognition of the "law of nature," which stipulates that we seek self-preservation. This basic instinct gave rise to Hobbes's political philosophy advocating for a sovereign. The sovereign was Hobbes's touchstone individual who need not surrender his rights, but act as the enforcer of them. Despite Hobbes's acknowledgement that man's state of war permitted killing, under the natural law and rule of the sovereign, man could in fact disobey the sovereign when the matter of self-preservation was concerned (i.e., the sovereign couldn't order anyone to harm themselves).
Locke doesn't acknowledge a natural state of war at any point wherein killing was acceptable. For Locke, unlike Hobbes, morality prevailed from the inception of social life. For example, in the Declaration of Independence, which espouses Locke's views on the state of nature, it is proposed that man's rights include "life, liberty and the pursuit of happiness." Locke proposes a moral imperative that Hobbes disavows. While Hobbes acknowledges that killing is wrong within the confines of the Social Contract, he allows that it is permissible—even rational—in the state of nature (before natural law).