dns: fix a similar null-dereference