Hi Neels
On Thu, Apr 14, 2016 at 04:38:42PM +0200, Neels Hofmeyr wrote:
Coverity complains about a 'Dereference before
null check' on *queue.
So, push the NULL check further up,
No question here.
but also, instead of handling a calloc failure as
error, rather abort
the program.
I think that's a much more fundamental question. Should we really abort
the program in this case? If so, why only in case of queue allocation
failures, but not in general at all memory allocation failures? And if
that's the case, wrapping calloc() / malloc() and other dynamic memory
allocation calls with a function that contains the abort() (or an
OSMO_ASSERT() on the result) might be more applicable?
--
- Harald Welte <laforge(a)gnumonks.org>
http://laforge.gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
(ETSI EN 300 175-7 Ch. A6)