davidsiaw / SDL2

Mirror of the official SDL2 repository
Other
20 stars 17 forks source link

1 byte memory leak. Conditional jumps or move depends on uninitialised value(s) #4

Open tonymin-gamedev opened 3 years ago

tonymin-gamedev commented 3 years ago

I wrote the simplest graphical Ping-Pong for Linux, and then decided to test it for memory leaks. The Valgrind utility wrote me about some bugs in libSDL2, as well as a 1 byte memory leak.

I first looked for a leak in my code, but I couldn't find it. Then I turned to people from the C chat room for help, but they didn't find a memory leak either, and then they told me to ask you about it.

Valgrind output: https://pastebin.com/hsDqPMxG

The attached ZIP file contains the source code, the game font, and a compiled Linux binary. If you want to run or compile the game, you need to install the SDL2_gfx library

Ping-Pong.zip