cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Memory leak using multi handle

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 27 Jun 2016 15:42:26 +0200 (CEST)

On Mon, 27 Jun 2016, Dan Donahue wrote:

> I am using libcurl 7.44.0 with ssh enabled and am experiencing a memory leak
> within libcurl when performing sftp upload/download.
>
> My design uses a singleton C++ class running in a single thread to perform
> libcurl upload/download functions. My code works for uploading/downloading
> several files simultaneously. The only issue I am experiencing is the memory
> leak. I have verified there are no leaks in my code.

And the leak stays at this memory amount or does it grow over time?

> The attached memdebug trace is what I am seeing after transferring (upload)
> one file.

It seems to imply that it is a multi handle that is never freed. It *could* be
a multi handle that's used privately within libcurl by an easy handle (because
it looks like there's a hash there with three entries that also aren't freed).
Does your program ever run a transfer with the easy interface?

If you can, running the code with valgrind will probably give us more details
of where and how exactly the leaks occur.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:  https://curl.haxx.se/mail/etiquette.html
Received on 2016-06-27