Omit '.' terminated files. They should not exist as files, and that helps avoid
including . and .. dirs.
[COVERITY] Fix memory leaks, some logically dead code, unneeded checks for pointers
(MM_FREE already checks that they're not null pointers), and a lot of cosmetic.
Avoid possible unsigned integer overflow.