Inside the second unit pick, you leak 2 locations per unit (1 due to you forgetting to remove the one stored in the variable before the next location is put in it and the second because you create a location via polar projection that you never remove).
You have to remove all locations you make unless you are using them as a constant in JASS which you clearly are not.
Also your trigger will not work, as you refer a matching unit when there can not be one.
I see you clearly do not understand what variables are so. . .
A variable holds a value. Thus once set it will always return that value. Inorder to change its value you have to update it (re set it) to a new value.
Set TempUnit = (Matching unit)
Will set TempUnit to what the matching unit is currently, thus if the matching unit changes as the trigger progresses, the unit that TempUnit refers to will be the same (not the current matching unit). You would have to update it every time the matching unit chhanges via "Set TempUnit = (Matching unit)" to get it to store the current matching unit.