Re: [hackers] [sent] Fix error-messages || FRIGN
Heyho,
Hiltjo Posthuma wrote:
> Here is a patch that improve the error messages a bit more and a patch that
> checks a memory allocation case.
Thanks, I clarified the split error messages in the first one a bit.
> Subject: [PATCH 2/2] check memory allocation for calloc, die on failure
>
> …
>
> - s->img = calloc(1, sizeof(Image));
> + s->img = ecalloc(1, sizeof(Image));
ecalloc does not call die() on failure. It just prints the errno string without
a prefix and then returns NULL. Should we change that to call die() instead? It
would simplify some cases in sent at least, where we currently call
malloc/calloc and check the return code. Is there a case in the other projects
where we don't want to die() on allocation failures? If there are just a few,
they might switch back from ecalloc to calloc. Another option might be to
introduce wecalloc like weprintf in sbase.
--Markus
Received on Fri Aug 12 2016 - 15:06:06 CEST
This archive was generated by hypermail 2.3.0
: Fri Aug 12 2016 - 15:12:19 CEST