Bug 801 - (minor) missing error condition handling in daemon_create_workers()
(minor) missing error condition handling in daemon_create_workers()
Product: unbound
Classification: Unclassified
Component: server
Other All
: P5 minor
Assigned To: unbound team
Depends on:
  Show dependency treegraph
Reported: 2016-07-21 20:20 CEST by JINMEI Tatuya
Modified: 2016-07-22 09:02 CEST (History)
2 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description JINMEI Tatuya 2016-07-21 20:20:49 CEST
daemon/daemon.c:daemon_create_workers() doesn't check the case where
the calloc call for workers fails:

	daemon->workers = (struct worker**)calloc((size_t)daemon->num, 
		sizeof(struct worker*));

Although pretty minor, it would still be better to catch this
condition and call fatal_exit().  If nothing else, it would be more
consistent with other error handling cases in this function.
Comment 1 Wouter Wijngaards 2016-07-22 09:02:34 CEST
Hi Jinmei,

Yes that is a lot better.  Thank you for the report.

Best regards, Wouter