The case of People v. Herrera that you are referring to is a case that has to do with what sorts of searches the police can carry out when they are in a consensual encounter with a civilian. There are other issues involved, but this was the most important issue.
In 1996, two police officers saw Herrera walking along carrying a gas can at 1:30 AM. He was near to an abandoned car. He was also partially blocking one lane of the road along which he was walking. The officers stopped and talked to him to determine if he was drunk. Herrera was eventually convicted of a crime, but I will address that fact in more depth later.
When Herrera appealed his conviction, he argued first that the police had no reasonable suspicion that he had committed a crime. Therefore, they should not have stopped him. The appeals court ruled that there was no probable cause that would have allowed the police to stop Herrera. Carrying a gas can toward an abandoned car is not evidence that you have probably committed a crime. Therefore, the police erred. However, the court said that this was not a reversible error because the police could have simply talked to Herrera in a consensual encounter.
Herrera also claimed that the encounter was not consensual. However, he gave no evidence to show that he felt he was not able to end the encounter if he wanted to. Therefore, the court ruled that the encounter was consensual.
We then come to the heart of the case. The officers decided Herrera was drunk. At that point, they took him into protective custody. They searched him and found a small pocket knife. They also found a clear baggie containing some substance that looked like marijuana. They dumped that out. They found some folded squares of paper. They opened those and found cocaine. This is what Herrera was convicted of.
Herrera claimed that the search was unconstitutional because the police had no reason to be searching him to the extent that they did. The appeals court agreed. It said that the police had the right to search Herrera to see if he had anything on him that could be used to hurt himself or them. It also said that they had the right to take all of his belongings, inventory them, and hold them to be returned when he was released.
There are two problems with how the police acted. First, they did not need to open the paper squares to determine if they could be used to hurt someone. Therefore, their search was excessive for its alleged purpose. Second, they did not actually do any sort of an inventory of what Herrera had. This proves that they were not really trying to inventory his belongings. Instead, the court found that the search of the paper squares was excessive and unjustified. Therefore, they sent the case back to lower court for further arguments.
Please refer to this link for further details: http://scholar.google.com/scholar_case?case=17703808020899747781&q=People+v.+Herrera,+1+P.3d+234&hl=en&as_sdt=6,48&as_vis=1