Don’t worry, this is a purely theoretical question!
If someone is planning to kill an innocent person and I know that he most likely will do it, and the only way to prevent him from doing that, is using force (e.g. lock him up) then am I allowed to do it.
If the answer is yes, does the same logic apply to abortion? If I knew, a woman is about to abort her baby, would it be morally acceptable to lock her up until the 12th week of pregnancy (in many countries it’s illegal to abort after the 12th week)? If no, could you give a good argument, why you think that?