While I don't know Petty's personal drug misuse story, and I'm sorry to read about this, my experience from working with drug users is, if someone is battling to give up an addiction, one of the first steps is to disassociate from others in your life who are also using, this is especially so with illegal drugs. Someone like me may have encouraged him to take this measure. Users deal to other users.
Addl: Plus, if you're trying to give up heroin, you are always at risk of relapsing and an accidental OD due to your tolerance level now likely being less ... plus you may even be dealt a higher dose level than your tolerance due to the shift in dealers. Again though, I don't know Petty's story, but if he was trying to give up, it would have been super wise to get that other user out of his life.