Vaginal bleeding during bowel movement.

Help! I have been getting a couple of spots of fresh blood during bowel movements. This only happens when constipated. It then causes a brown discharge for a day after. This has happened before was pregnant but worried about the baby. What could cause this?