cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Sending SOAP query using CURLOPT_POST not working for me

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 4 Jan 2010 23:28:39 +0100 (CET)

On Mon, 4 Jan 2010, Lars Nilsson wrote:

>>>        mem->memory = (char *)realloc(mem->memory, mem->size + realsize
>>> + 1);                 // Application crashes here.
>>
>> Well yes, as 'mem' is NULL...
>
> realloc() shouldn't have a problem dealing with a NULL pointer.

Right, but the code never reaches realloc(). Read the code again and notice
that 'mem' is NULL in the above scenario. It will try to read data from a
struct at adress 0x0 and that won't work. 'mem->memory' is illegal (and so is
mem->size).

-- 
  / daniel.haxx.se

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-01-04