How are you detecting the “memory leak”? Your code terminates the process (return 0;) so any memory used will be automatically freed by the OS at that point. I don’t think that should qualify as a ‘leak’.
This is what Microsoft blogger Raymond Chen has to say on the subject of freeing memory on process termination: “All this anal-retentive memory management is pointless. The process is exiting. All that memory will be freed when the address space is destroyed. Stop wasting time and just exit already”.
I’m running it via valgrind. This isn’t an issue on a technical level perhps, since it will be freed by the OS, but having unfreed memory as part of SDL2 makes it difficult to detect when code I’m writing has memory issues.