[flashrom] [PATCH] ft2232_spi: Improve error handling, remove exit() calls

Uwe Hermann uwe at hermann-uwe.de
Thu Jul 21 20:25:11 CEST 2011


On Thu, Jul 21, 2011 at 02:50:36AM +0300, Tadas Slotkus wrote:
> Hi,
> >                 buf = realloc(buf, bufsize);
> >                 if (!buf) {
> >                         msg_perr("Out of memory!\n");
> > -                       exit(1);
> > +                       /* TODO: What to do with buf? */
> > +                       return SPI_GENERIC_ERROR;
> >                 }
> Not looked very deeply, but looks like this is not freed even when in
> normal execution(until program termination). Checkings would add ugly
> lines. I do believe that we won't end up in memleaks, so if I have a

You're probably right, yes, I left the TODO in there for now, until
we're sure.


> right, then:
> Acked-by: Tadas Slotkus <devtadas at gmail.com>

Thanks, r1377.


Uwe.
-- 
http://hermann-uwe.de     | http://sigrok.org
http://randomprojects.org | http://unmaintained-free-software.org




More information about the flashrom mailing list