2,505. Other Cases of Improper Intentions
Hilchos Shechita 2:16
If someone slaughters an animal and later thinks to sprinkle its blood or to burn its fats to an idol, it is prohibited out of the doubt involved; the ends might reveal what his intention was all along, and maybe he really did slaughter with that intention.
Hilchos Shechita 2:17
If someone slaughters an animal in the name of a sacrifice that could be consecrated through a pledge or a vow, the slaughter is invalid because it’s like slaughtering a consecrated animals outside the Temple grounds. If he slaughters an animal in the name of a sacrifice that couldn’t be consecrated through a vow or a pledge, the slaughter is valid.