All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
A person who is in a state of Ihraam is not sinful for killing a fly and he is not obliged to offer a sacrifice for doing so.
Rather, a person who is in a state of Ihraam is only prohibited from killing any Islamicly edible wild land game but he is not prohibited from killing harmful animals or insects according to the view of many scholars . Indeed, the jurists stated that it is permissible to kill flies, mosquitoes and bugs in a state of Ihraam and one is not obliged to offer a sacrifice for doing so.
Allaah Knows best.