curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: Memory leak with curl_multi_socket_action

From: Daniel Stenberg via curl-library <curl-library_at_cool.haxx.se>
Date: Mon, 25 May 2020 08:56:24 +0200 (CEST)

On Sun, 24 May 2020, James Read via curl-library wrote:

> ==78076== by 0x48BBEE0: curl_dbg_calloc (memdebug.c:205)
> ==78076== by 0x490A1D0: Curl_ssl_initsessions (vtls.c:608)

This is the TLS session ID cache. Do you cleanup this multi handle correctly?

> ==78076== by 0x489E601: allocate_conn (url.c:1562)
> ==78076== by 0x48A28CA: create_conn (url.c:3378)

This is a connection struct used for holding on to everything that is related
to a single connection. This is possibly due to not having cleaned up the
multi handle too, or perhaps an easy handle.

> ==78076== by 0x489C739: Curl_open (url.c:588)
> ==78076== by 0x488DCF4: curl_easy_init (easy.c:301)

This is an easy handle. Missing a call to curl_easy_cleanup() ?

> ==78076== at 0x483B723: malloc (in
> /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==78076== by 0x483E017: realloc (in
> /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==78076== by 0x10CA22: write_cb (crawler.c:277)
> ==78076== by 0x48D707B: chop_write (sendf.c:606)

This is your callback code doing the allocation (realloc really).

-- 
  / daniel.haxx.se | Commercial curl support up to 24x7 is available!
                   | Private help, bug fixes, support, ports, new features
                   | https://www.wolfssl.com/contact/
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2020-05-25