The leak happens when there is a muted group node in a shader node tree which is
rendered. For rendering, the drawing code "localizes" the node tree which also
means duplicating the node groups used by each group node (might even duplicate
the same group more than once if it's used by multiple nodes). Generally, this
works fine, because all of these duplicates are freed when the tree is
flattened.
However, there is a preprocessing step which deletes all muted nodes from the
tree. This code path did not free the groups recursively.
Pull Request: https://projects.blender.org/blender/blender/pulls/129124