I am running valgrind in a bash script, and directing the valgrind's output to a file. Like this :
valgrind --leak-check=full --show-reachable=yes --xml=yes --xml-file=unit_tests_valgrind.out.xml ./unit_tests_runner
The RET_VALUE=$?
is going to put the return value of the program (unit_tests_runner above), not from valgrind. And the only way to check whether the valgrind found memory problems is to open the log.
Is there a way to check in a script whether there are memory problems? If yes, how?