cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: http headers free and multi

From: Mohun Biswas <m_biswas_at_mailinator.com>
Date: Sat, 14 Oct 2006 08:53:50 -0400

Daniel Stenberg wrote:
> Yes, in a simple application you always know that you allocated the URL
> so you could unconditionally curl_easy_getopt(URL) and free it. But as
> has been seen so many times over, people write more complicated
> libcurl-using apps than so, and therefore will the sitaution very likely
> end up like: time to free some resources, and depending on what
> resources we allocated before we need to free exactly those.
>
> For the app's cleanup-function to know what resources to free in this
> scenario, it would need to do bookkeeping and ask for and free exactly
> those pointers it previously allocated. This extra bookkeeping, would
> need to be passed around by the application and IF that extra
> bookkeeping is passed around anyway, what's the big difference to it if
> it would also keep the actual pointers of the memory allocations?

Hmm. This has never happened in any of my code, and not all of it is
simple. But I'm sure you've seen - not to mention written - far more
libcurl-using code than I have so if you say it's a concern, I believe you.

MB
Received on 2006-10-14