valgrind(1) --tool=memcheck --leak-check=yes --show-reachable=yes ./your_program
a suite of tools for debugging and profiling programs
--tool=<toolname> [default: memcheck]
    Run the Valgrind tool called toolname, e.g. Memcheck, Cachegrind, etc.
--leak-check=<no|summary|yes|full> [default: summary]
    When enabled, search for memory leaks when the client program finishes. If set to summary, it says
    how many leaks occurred. If set to full or yes, it also gives details of each individual leak.
--show-reachable=<yes|no> [default: no]
    When disabled, the memory leak detector only shows "definitely lost" and "possibly lost" blocks. When
    enabled, the leak detector also shows "reachable" and "indirectly lost" blocks. (In other words, it
    shows all blocks, except suppressed ones, so --show-all would be a better name for it.)
source manpages: valgrind