When a lawful arrest is effected, a peace officer may reasonably search the person arrested and the area within such person's immediate presence for the purpose of: (1) protecting the officer from attack; (2) preventing the person from escaping; (3) discovering and seizing the fruits of the crime; or (4) discovering and seizing any persons, instruments, articles, or things which may have been used in the commission of or which may constitute evidence of the offense.