Important: If you're using valgrind to examine a program using certain libraries, remember to also provide valgrind with so called "suppressions".
Some libraries do things (like juggling memory in interesting ways) that can cause valgrind to give false positives and lead you on wild goose chases. I have found this to be the case for e.g. GLib - it may perform correctly, but valgrind can't tell and so it warns. Suppressions solve this neatly.