See patch.
This is just a first step, there is certainly room for further improving the error handling (error #defines such as FL_ERR_MALLOC, consistent and documented return codes, and more).
Uwe.
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 right, then: Acked-by: Tadas Slotkus devtadas@gmail.com
By the way, great job in wiki and flashrom GUI :)
Thanks, Tadas
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@gmail.com
Thanks, r1377.
Uwe.