Just add some macros in your code.
#include <valgrind/memcheck.h> int func() { // ... VALGRIND_DO_CHANGED_LEAK_CHECK // ... }
REF: http://valgrind.org/docs/manual/mc-manual.html#mc-manual.clientreqs
#include <valgrind/memcheck.h> int func() { // ... VALGRIND_DO_CHANGED_LEAK_CHECK // ... }