Valgring is very friendly: ==1== More than 1000 different errors detected. I'm not reporting any more. ==1== Final error counts will be inaccurate. Go fix your program!