curl-library
Memory leaks
Date: Sun, 04 Apr 2010 12:14:51 +0200
Hey there,
I am using the libcurl version from Ubuntu 9.10 (7.19.5), so everything
I talk about may be fixed already.
I'm using the example from
http://curl.haxx.se/libcurl/c/getinmemory.html . Despite its calls to
curl_easy_cleanup() and curl_global_cleanup() it still leaks memory:
==6319== 8 bytes in 1 blocks are still reachable in loss record 1 of 7
==6319== at 0x4C25153: malloc (vg_replace_malloc.c:195)
==6319== by 0x6794F91: CRYPTO_malloc (in /lib/libcrypto.so.0.9.8)
==6319== by 0x67E6793: engine_cleanup_add_last
(in /lib/libcrypto.so.0.9.8)
==6319== by 0x67E70F1: ENGINE_add (in /lib/libcrypto.so.0.9.8)
==6319== by 0x67E9D30: ENGINE_load_dynamic
(in /lib/libcrypto.so.0.9.8)
==6319== by 0x5067758: ??? (in /usr/lib/libcurl.so.4.1.1)
==6319== by 0x5070631: curl_global_init
(in /usr/lib/libcurl.so.4.1.1)
==6319== by 0x4010BD: screemr_blah (screemr.c:55)
==6319== by 0x4013CF: main (main.c:162)
==6319==
==6319== 24 bytes in 1 blocks are still reachable in loss record 2 of 7
==6319== at 0x4C25153: malloc (vg_replace_malloc.c:195)
==6319== by 0x6794F91: CRYPTO_malloc (in /lib/libcrypto.so.0.9.8)
==6319== by 0x6516CDB: ??? (in /lib/libssl.so.0.9.8)
==6319== by 0x6516EC8: SSL_COMP_get_compression_methods
(in /lib/libssl.so.0.9.8)
==6319== by 0x651D33F: SSL_library_init (in /lib/libssl.so.0.9.8)
==6319== by 0x5067762: ??? (in /usr/lib/libcurl.so.4.1.1)
==6319== by 0x5070631: curl_global_init
(in /usr/lib/libcurl.so.4.1.1)
==6319== by 0x4010BD: screemr_blah (screemr.c:55)
==6319== by 0x4013CF: main (main.c:162)
==6319==
==6319== 32 bytes in 1 blocks are still reachable in loss record 3 of 7
==6319== at 0x4C25153: malloc (vg_replace_malloc.c:195)
==6319== by 0x6794F91: CRYPTO_malloc (in /lib/libcrypto.so.0.9.8)
==6319== by 0x67F394E: sk_new (in /lib/libcrypto.so.0.9.8)
==6319== by 0x67E67B4: engine_cleanup_add_last
(in /lib/libcrypto.so.0.9.8)
==6319== by 0x67E70F1: ENGINE_add (in /lib/libcrypto.so.0.9.8)
==6319== by 0x67E9D30: ENGINE_load_dynamic
(in /lib/libcrypto.so.0.9.8)
==6319== by 0x5067758: ??? (in /usr/lib/libcurl.so.4.1.1)
==6319== by 0x5070631: curl_global_init
(in /usr/lib/libcurl.so.4.1.1)
==6319== by 0x4010BD: screemr_blah (screemr.c:55)
==6319== by 0x4013CF: main (main.c:162)
==6319==
==6319== 32 bytes in 1 blocks are still reachable in loss record 4 of 7
==6319== at 0x4C25153: malloc (vg_replace_malloc.c:195)
==6319== by 0x6794F91: CRYPTO_malloc (in /lib/libcrypto.so.0.9.8)
==6319== by 0x67F396C: sk_new (in /lib/libcrypto.so.0.9.8)
==6319== by 0x67E67B4: engine_cleanup_add_last
(in /lib/libcrypto.so.0.9.8)
==6319== by 0x67E70F1: ENGINE_add (in /lib/libcrypto.so.0.9.8)
==6319== by 0x67E9D30: ENGINE_load_dynamic
(in /lib/libcrypto.so.0.9.8)
==6319== by 0x5067758: ??? (in /usr/lib/libcurl.so.4.1.1)
==6319== by 0x5070631: curl_global_init
(in /usr/lib/libcurl.so.4.1.1)
==6319== by 0x4010BD: screemr_blah (screemr.c:55)
==6319== by 0x4013CF: main (main.c:162)
==6319==
==6319== 32 bytes in 1 blocks are still reachable in loss record 5 of 7
==6319== at 0x4C25153: malloc (vg_replace_malloc.c:195)
==6319== by 0x6794F91: CRYPTO_malloc (in /lib/libcrypto.so.0.9.8)
==6319== by 0x67F394E: sk_new (in /lib/libcrypto.so.0.9.8)
==6319== by 0x6516CB9: ??? (in /lib/libssl.so.0.9.8)
==6319== by 0x6516EC8: SSL_COMP_get_compression_methods
(in /lib/libssl.so.0.9.8)
==6319== by 0x651D33F: SSL_library_init (in /lib/libssl.so.0.9.8)
==6319== by 0x5067762: ??? (in /usr/lib/libcurl.so.4.1.1)
==6319== by 0x5070631: curl_global_init
(in /usr/lib/libcurl.so.4.1.1)
==6319== by 0x4010BD: screemr_blah (screemr.c:55)
==6319== by 0x4013CF: main (main.c:162)
==6319==
==6319== 32 bytes in 1 blocks are still reachable in loss record 6 of 7
==6319== at 0x4C25153: malloc (vg_replace_malloc.c:195)
==6319== by 0x6794F91: CRYPTO_malloc (in /lib/libcrypto.so.0.9.8)
==6319== by 0x67F396C: sk_new (in /lib/libcrypto.so.0.9.8)
==6319== by 0x6516CB9: ??? (in /lib/libssl.so.0.9.8)
==6319== by 0x6516EC8: SSL_COMP_get_compression_methods
(in /lib/libssl.so.0.9.8)
==6319== by 0x651D33F: SSL_library_init (in /lib/libssl.so.0.9.8)
==6319== by 0x5067762: ??? (in /usr/lib/libcurl.so.4.1.1)
==6319== by 0x5070631: curl_global_init
(in /usr/lib/libcurl.so.4.1.1)
==6319== by 0x4010BD: screemr_blah (screemr.c:55)
==6319== by 0x4013CF: main (main.c:162)
==6319==
==6319== 192 bytes in 1 blocks are still reachable in loss record 7 of 7
==6319== at 0x4C25153: malloc (vg_replace_malloc.c:195)
==6319== by 0x6794F91: CRYPTO_malloc (in /lib/libcrypto.so.0.9.8)
==6319== by 0x67E68B6: ENGINE_new (in /lib/libcrypto.so.0.9.8)
==6319== by 0x67E9C95: ENGINE_load_dynamic
(in /lib/libcrypto.so.0.9.8)
==6319== by 0x5067758: ??? (in /usr/lib/libcurl.so.4.1.1)
==6319== by 0x5070631: curl_global_init
(in /usr/lib/libcurl.so.4.1.1)
==6319== by 0x4010BD: screemr_blah (screemr.c:55)
==6319== by 0x4013CF: main (main.c:162)
I don't know if this a bug imported from your linked libraries or if
it's your fault forgetting to tell them to free their resources.
Greetings,
Julian
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
- application/pgp-signature attachment: This is a digitally signed message part