curl / Mailing Lists / curl-library / Single Mail


open ssl vs gnutls used along with libcurl

From: surya chandrika via curl-library <>
Date: Fri, 5 Oct 2018 14:07:08 +0530

Hi All,

There is a weird memory leak in my program.

Valgrind shows:

We have a usecase within program which uses gnu encrypt decrypt function,
and it reports leaks.

==57842== 775 (152 direct, 623 indirect) bytes in 1 blocks are definitely
lost in loss record 2,287 of 2,663

==57842== at 0x4C29975: calloc (vg_replace_malloc.c:711)

==57842== by 0xF62230B: ??? (in /usr/lib64/

==57842== by 0xF6224BB: asn1_create_element (in

==57842== by 0x7B1ACB2: ??? (in /usr/lib64/

==57842== by 0x7B1D8F3: ??? (in /usr/lib64/

==57842== by 0x7B1DC75: gnutls_x509_privkey_export_pkcs8 (in

So i was searching a bit about gnu and found this link, where it states
gnu used along curl can also leak

Is there any known issues like curl with gnu has leaks?

Will switching to openssl solve this problem as stated in this link?


Also in valgrind i can see , opessl backtrace even though am using gnutls ,
is this related:

==70015== 24 bytes in 1 blocks are still reachable in loss record 27 of 662

==70015== at 0x4C27BE3: malloc (vg_replace_malloc.c:299)

==70015== by 0xDCCC3B7: CRYPTO_malloc (in /usr/lib64/

==70015== by 0xDCCF238: OBJ_NAME_add (in /usr/lib64/

==70015== by 0xDD8E394: EVP_add_cipher (in

==70015== by 0xDD92E8C: OpenSSL_add_all_ciphers (in

==70015== by 0xDD92B4D: OPENSSL_add_all_algorithms_noconf (in

==70015== by 0x1014B428: libssh2_init (in /usr/lib64/

==70015== by 0x7DEF936: curl_global_init (easy.c:273)

3. I have 182 hits for the below backtrace in my valgrind log , although
its invoked only once and global cleanup in invoked at the end of program.
This program is a long running program and we dont expect to stop or
restart in between.

==70015== at 0x4C27BE3: malloc (vg_replace_malloc.c:299)

==70015== by 0x11135142: PR_ErrorInstallTable (in /usr/lib64/

==70015== by 0x111353A8: ??? (in /usr/lib64/

==70015== by 0x7E1C0E4: Curl_nss_init (nss.c:1244)

==70015== by 0x7DEF924: curl_global_init (easy.c:239)

==70015== by 0x4FE080: General::CURLInstance::curlGlobalinit()

Similarly i have several hits for the point 2 back log as well.

Apart from such backtraces i didnt find any valuable leaks in valgrind
which could cause heavy leaks,

Any comments or help would be greatly appreciated .



Received on 2018-10-05