Some states bar candidates who sought, but failed, to secure the nomination of a political party from running as independents in the general election. Ballot access expert Richard Winger has argued that, generally speaking, "sore loser laws have been construed not to apply to presidential primaries." In August 2015, Winger compiled a list of precedents supporting this interpretation. He argued that in 43 of the 45 states with sore loser laws on the books, the laws do not seem to apply to presidential candidates. Winger claimed that sore loser laws apply to presidential candidates in only two states: South Dakota and Texas.
Ballotpedia: "Sore loser" laws for presidential candidatesAlabama (write-in)