Valgrind isn't of any help?
Valgrind gives a lot of false alarms in the Image module on 64 bit architectures, though. The problem is that gcc can generate a 64 bit read when rgb_group structs are read, and if that happens near the end of a malloced block then valgrind complains about reading outside addressable memory. I've got some half-baked patches to pad the malloced blocks more when --with-valgrind is used.