In my C program, I use some basic libcurl functions. Today I ran valgrind to check for memory leaks, and valgrind went crazy reporting a few errors.
I traced it mainly to:
CURL *curl; CURLcode res; curl = curl_easy_init();
If I completely remove the code that libcurl uses, valgrind does not report any errors.
I already read that there are some problems using valgrind with libcurl and ssl, but I do not take any https addresses, etc.
What can I do? Can I make valgrind shut up about libcurl errors (possible false positives?) And report only errors from my code? Due to the sheer number of errors, despite the simplest use of libcurl, the output of valgrind is rather confusing.
Unfortunately, I don't have debugging built from libcurl, so valgrind does not even report the line / file numbers where it detected leaks. Error messages look like this:
==27330== ==27330== HEAP SUMMARY: ==27330== in use at exit: 34,960 bytes in 2,406 blocks ==27330== total heap usage: 20,130 allocs, 17,724 frees, 2,511,576 bytes allocated ==27330== ==27330== 40 (20 direct, 20 indirect) bytes in 1 blocks are definitely lost in loss record 383 of 445 ==27330== at 0x4025BD3: malloc (vg_replace_malloc.c:236) ==27330== by 0x4B173FD: ??? ==27330== by 0x4B17A8B: ??? ==27330== by 0x4B84957: ??? ==27330== by 0x4B849FD: ??? ==27330== by 0x4B72814: ??? ==27330== by 0x4B734C1: ??? ==27330== by 0x4B78DE2: ??? ==27330== by 0x4B7524B: ??? ==27330== by 0x49B2F76: ??? ==27330== by 0x49C9ECB: ??? ==27330== by 0x49BC96A: ??? ...
source share