cURL / Mailing Lists / curl-library / Single Mail

curl-library

Stupid question about callbacks

From: Brian Akins <bakins_at_web.turner.com>
Date: Tue, 24 Aug 2004 08:09:49 -0400

This is more a libcurl user question, but:

In a callback such as:

size_t <http://curl.haxx.se/lxr/ident?i=size_t>
WriteMemoryCallback <http://curl.haxx.se/lxr/ident?i=WriteMemoryCallback>(void *ptr, size_t <http://curl.haxx.se/lxr/ident?i=size_t> size <http://curl.haxx.se/lxr/ident?i=size>, size_t <http://curl.haxx.se/lxr/ident?i=size_t> nmemb, void *data <http://curl.haxx.se/lxr/ident?i=data>)

Who "owns" the memory pointed to by ptr, the callback or the
curl_handle? Does the callback need to free it or does it always need
to memcpy it.

Stupid question, I know, but I don't think I've found this documented
anywhere.

-- 
Brian Akins
Senior Systems Engineer
CNN Internet Technologies
Received on 2004-08-24