Beware of vehicular traffic. Crossing the streets is always dangerous even when using a pedestrian crosswalk with the traffic light red for cars. As one member of Supergrass band once said: "In Brazil green means go, and red means go faster!" Start the crossing ONLY when vehicles have already stopped.
As with other large Brazilian cities, Salvador is notorious for street crime; muggings and knifings happens! Avoid travelling through the city by yourself at night.
When you go to the police they are pretty lax. In fact, it is rumoured that the police and street children work together. With that said, it is pointless to trust the police.
Often, there are heavily guarded areas with many police, but just outside of that area are the muggers waiting for the tourists.
These days the Pelourinho, formerly one of the most dangerous areas, is heavily patrolled by police. Remember they are there for a reason, though. But also other areas, which are strongly frequented by foreigners, can become dangerous, especially at night, i.e. the Barra harbour area. Avoid dark and lonely places at night, i.e. the Jesus Christ Statue at Barra. You shouldn't go to the beach at night!
The long sloping road leading from the old town to the harbor should be avoided. Why don't you just take the elevator?
If you are staying in the touristic Barra area, beware of the favela near Shopping Barra, especially at night. The area just to the east toward the beach can be dangerous as well.