cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-library Mailing List Archives

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

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET