On Mon, 4 Jan 2010, [email protected] wrote:

struct MemoryStruct *bodyStruct=NULL;

... a global pointer pointing to NULL.

size_t WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void
*data)
{
        register int realsize = size * nmemb;
        struct MemoryStruct *mem = (struct MemoryStruct *)data;

        mem->memory = (char *)realloc(mem->memory, mem->size + realsize
+ 1);                 // Application crashes here.

Well yes, as 'mem' is NULL...

        curl_easy_setopt(ch, CURLOPT_FILE, bodyStruct);

... as set here.

Also, I have kept the lines, I am not sure about, in bold.

Not really, my mail is text only and bold doesn't do well in text-only...

--

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

Reply via email to