Modify query_getcachedb() so that it uses a common return path for both success and failure. Remove a redundant NULL check since 'db' will never be NULL after being passed as a target pointer to dns_db_attach(). Fix coding style issues.