cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Wonder on curl_easy_getinfo()

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Wed, 9 Aug 2006 13:58:15 -0700

On Wed, Aug 09, 2006 at 12:50:50PM -0700, Cyril Picat wrote:
> In a first time, looking at the documentation of
> curl_easy_get_info(), I was not deleting the pointer
> to the long because of the sentence 'You should not
> free the memory returned by this function unless it is
> explictly mentioned below' written in the doc. I was
[...]
> So my question is: am I wrong and, if not, what is the
> exact meaning of this sentence ?

For CURLINFO_RESPONSE_CODE, curl_easy_getinfo does not return any memory
(i.e. a pointer to memory); it only returns a long integer. Some CURLINFO
types do return memory (e.g. CURLINFO_EFFECTIVE_URL), and you are not allowed
to free() such pointers.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2006-08-09