Fixed NULL dereferences in the dns client