In informal speech “bad” is sometimes used as an adverb: “the toilet was leaking pretty bad” or “my arm hurt so bad I thought it was broken.” In formal writing, “badly” is preferred in both contexts.