mghorba
December 8th, 2016, 07:45 PM
Can valgrind be used to find the memory leaks in a function called as a library by another function?
I have a "main" that calls another c project as a library. I am running valgrind for the executable of the "main", and valgrind finds memory issues in the "main" body. But it does not indicate about the separate c project which is called as a library. I intentionally placed a malloc in the called project and did not free and Valgrrind did not find it in the report.
Are there any commands that would give me the capability to run a project as library and find memory leaks with valgrind?
I have tried "valgrind --leak-check=full --track-origins=yes" and "valgrind --leak-check=yes" commands and it only finds the memory leaks in the "main" and not the c functions called by the "main" as library.
I have a "main" that calls another c project as a library. I am running valgrind for the executable of the "main", and valgrind finds memory issues in the "main" body. But it does not indicate about the separate c project which is called as a library. I intentionally placed a malloc in the called project and did not free and Valgrrind did not find it in the report.
Are there any commands that would give me the capability to run a project as library and find memory leaks with valgrind?
I have tried "valgrind --leak-check=full --track-origins=yes" and "valgrind --leak-check=yes" commands and it only finds the memory leaks in the "main" and not the c functions called by the "main" as library.