Memory leaks can certainly be more sinister than the example used here.
It's not possible to never use global state — it makes sense in some cases. And then you end up with harmless things like adding memoization leaking memory when not done properly.