There were two issues here. First, if socket() fails then it's treated as an unrecoverable error and second: the response buffer was not initialized and so a recoverable error (ie. no nscd) would result in UB. dgp tested this patch and confirmed on IRC that it worked in the no-nscd no-socket case and I have tested it in the has-nscd case.