Once your code is compiled with the proper options, you execute it within Valgrind with the following command :
[name@server ~]$ valgrind --tool=memcheck --leak-check=yes --show-reachable=yes ./your_program