first install valgrind, its newest ver is 3.11, and stops updating since 2015/12. in centos, yum installs 3.10 ver. using valgrind ./buggy.out to execute memcheck tool in valgrind, other useful tools can be found in the man page. specify --leak-check…