fix: local_hosts set keys and shallow free returns

This commit is contained in:
Willem Toorop 2014-10-23 23:25:55 +02:00
parent 4a3d7fd8b2
commit 73dc0f27da
1 changed files with 3 additions and 1 deletions

View File

@ -158,6 +158,7 @@ create_local_hosts(struct getdns_context *context)
GETDNS_FREE(context->my_mf, hnas);
break;
}
hnas->node.key = hnas->host_name;
(void) getdns_rbtree_insert(
&context->local_hosts, &hnas->node);
}
@ -1955,7 +1956,8 @@ getdns_context_local_namespace_resolve(
if (!result_list)
return GETDNS_RETURN_GENERIC_ERROR;
*response = create_getdns_response_from_rr_list(dnsreq, result_list);
ldns_rr_list_deep_free(result_list);
/* Not deep_free because ldns_rr_list_cat doesn't clone the rr's */
ldns_rr_list_free(result_list);
return *response ? GETDNS_RETURN_GOOD : GETDNS_RETURN_GENERIC_ERROR;
}