cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Memory leak using multi handle

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 28 Jun 2016 00:53:04 +0200 (CEST)

On Mon, 27 Jun 2016, Dan Donahue wrote:

>> a multi handle that's used privately within libcurl by an easy handle
>> (because 

> Why would an app's dynamically allocated multi handle be used "privately"
> within libcurl?

It looked like it could be a dynamically allocated multi handle, but not the
app's multi handle. When you use the easy interface and perform transfers,
libcurl itself uses the multi interface internally and the allocations you
showed looked like the could've been from the allocation of such a multi
handle.

> And why would a curl_multi_cleanup of the handle indicate success when
> clearly it's not? 

Because of a bug perhaps?

> How is an app to know its multi handle is being privately used by libcurl so
> it can clean it up some other manner? How is a privately used multi handle
> cleaned up?

Not at all. libcurl frees such handles itself when the easy handle is freed.
It was made internally and is freed internally.

> Could the entries be allocated with each call to curl_multi_perform?
> (Assuming it takes 3 calls to complete the transfer)

I don't see how it could, but then I don't claim to understand how the leak
occurs so I won't rule anything out until I have more clarity.

-- 
  / 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-28