Basically, the condition creates a group, then places all units within range into that group. It then checks if the group is empty. If it is, then the actions push through. The leak happens when it creates a group and then just leaves the group there without destroying it after it is used.
Fortunately, most of the group-related commands in the GUI have a feature that checks if bj_wantDestroyGroup (a global, blizzard-defined variable that's false by default) is true. If it is, then they destroy the group. They set the value of bj_wantDestroyGroup to false right after they finish though, so you have to keep doing it every time you use a group-related thing.
The custom script I added sets bj_wantDestroyGroup to true, that way the groups created are destroyed as soon as they are used. This method prevents leaks for the following GUI commands:
Conditions:
Unit Group - Units of Unit Group Are Dead
Unit Group - Unit Group Is Empty
Actions:
Unit Group - Pick Every Unit in Unit Group and do Action
Unit Group - Pick Every Unit in Unit Group and do Multiple Actions
Unit Group - Remove Group (destroys temporary group in which units to be removed are stored, it will still leak* the group from which they were removed.)
Unit Group - Add Group (destroys temporary group in which units to be added are stored, it will still leak* the group to which they were added.)
*Technically, it's not a leak if you still use the groups later on and destroy them in the proper time, which you probably will.
All other group-related commands have to have the groups stored in a variable to be destroyed later. Of course, the easiest way to prevent leaks without memorizing this list (or knowing JASS and having a list of functions) is to just store each group in a variable, then destroying the groups when you're done with them.
I'm sorry if it's kinda hard to understand, the whole thing's pretty hard for me to explain without going into JASS.