First of all, I would not worry that having a dream like this means that you are capable of doing such a thing in real life. People often do things in dreams that they would never do in reality.

Sometimes other people in dreams represent a part of ourselves. Maybe this dream means that you are purging yourself of a bad habit, or something else in your life that wasn't good. Does that make sense?

Hope this helped a little bit..