cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: OS400 ftp server related problem

From: Michael Wood <esiotrot_at_gmail.com>
Date: Tue, 18 Aug 2009 19:48:34 +0200

2009/8/18 Patrick Monnerat <Patrick.Monnerat_at_datasphere.ch>:
> Daniel Stenberg wrote:
>
>> I only spotted one nit: it calls malloc() and assumes it'll always
> work so it will quickly fail a "torture test".
>
> Not true, unless I missed something:
>
>       char *os = malloc(nread+1);
>       char *store=os;
>       char *ptr=&data->state.buffer[4];
>
>       if(!os)
>         return CURLE_OUT_OF_MEMORY;

Perhaps you should put the "malloc()" and the "if(!os) return ..."
together to avoid confusion?

-- 
Michael Wood <esiotrot_at_gmail.com>
Received on 2009-08-18