The code in question 4 is not a memory leak by any reasonable definition of memory leak. Allocating a fixed amount of memory and using it until the program terminates, without ever bothering to free it, is a perfectly valid programming practice. Why should it trouble anyone more than say a statically allocated global array? In fact, it's a wiser thing to do than religiously freeing everything at exit.
An actual memory leak is when the amount of memory program allocates grows with runtime while the amount of data the program is processing remains the same.
An actual memory leak is when the amount of memory program allocates grows with runtime while the amount of data the program is processing remains the same.