Lars Nilsson skrev 2011-03-14 17:42:
On Mon, Mar 14, 2011 at 12:33 PM, Felix E. Klee<[email protected]>  wrote:
Code snippet:

  char *data = malloc(100);

...
By passing a pointer to char *, accomplished by using&data in the
call instead of data.

Lars Nilsson
Also make sure not to allocate any memory for your pointer before doing the function call, as this would lead to a memory leak. The libcURL call itself allocates the memory needed to store the data you've requested before giving you the pointer to that memory back.

Best regards
Patrik Thunström / [email protected]


-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Reply via email to