Change to using calloc to allocate the memory for the dbconns array,
as this will ensure that all the pointers in it are NULL which
prevents us segfaulting on abnormal cleanup. Fixes the segfault from
Debian bug #520117 but not the underlying issue.
- dbconns = malloc(sizeof (DB *) * numdbs);
+ dbconns = calloc(numdbs, sizeof (DB *));
if (dbconns == NULL) {
logthing(LOGTHING_CRITICAL,
"Couldn't allocate memory for dbconns");
if (dbconns == NULL) {
logthing(LOGTHING_CRITICAL,
"Couldn't allocate memory for dbconns");