cURL / Mailing Lists / curl-library / Single Mail


Re: Modifying the example source code

From: Tor Arntsen <>
Date: Tue, 1 Mar 2011 17:06:50 +0100

On Mon, Feb 28, 2011 at 23:13, Ben Noordhuis <> wrote:
> On Mon, Feb 28, 2011 at 09:34, Tor Arntsen <> wrote:
>> Just to pre-answer a question people may ask.. realloc(NULL) works
>> fine on many architectures. But not on all architectures. To be
>> perfectly portable we use the malloc(1) trick.
> Tor, do you happen to know on what platforms or architectures
> realloc(NULL) causes issues? ISO mandates that it should be
> functionally equivalent to malloc() and I use it like that in my own
> code. It's never blown up so far but if there are portability issues,
> I'd like to be one step ahead of them.

AIX 4.x comes to mind. Note that it doesn't crash all the time.. only sometimes.

List admin:
Received on 2011-03-01