cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: newbie question

From: Michael Mastroianni <MMastroianni_at_choicestream.com>
Date: Tue, 24 Aug 2004 16:33:36 -0400

I said it was a newbie question because I thought I was probably being
stupid :).

I am confused about how it's allocated, I guess. How does it get cleaned
up?
I suppose that if the man page said you shouldn't free it, because curl
does, it probably would have helped me.

I was (incorrectly) inferring from the documentation on curl_free that I
should free it that way.

Thanks for the answer.

Regards,
Michael

-----Original Message-----
From: curl-library-bounces_at_cool.haxx.se
[mailto:curl-library-bounces_at_cool.haxx.se] On Behalf Of Daniel Stenberg
Sent: Tuesday, August 24, 2004 4:20 PM
To: libcurl development
Subject: Re: newbie question

On Tue, 24 Aug 2004, Michael Mastroianni wrote:

> Suppose I want to get the effective url for a download. My
understanding
> is that I do:

> curl_easy_getinfo(curlHandle_, CURLINFO_EFFECTIVE_URL,
&newurl);
>
> Now, I don't want to leak. Do I curl_free(newurl)?

...

> I think the last one is right, from the documentation, but I wanted to
be
> sure.

The documentation says nothing about needing to free the data and you
shouldn't.

You want the curl_easy_getinfo man page to explicitly say you should not
free
it? Would that have helped you?

-- 
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
       Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2004-08-24