2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-05 00:55:24 +00:00

The dns_message_create() cannot fail, change the return to void

The dns_message_create() function cannot soft fail (as all memory
allocations either succeed or cause abort), so we change the function to
return void and cleanup the calls.
This commit is contained in:
Ondřej Surý
2020-09-25 11:51:36 +02:00
parent 7deaf9a93c
commit 33eefe9f85
23 changed files with 147 additions and 172 deletions

View File

@@ -2277,12 +2277,8 @@ ns__client_setup(ns_client_t *client, ns_clientmgr_t *mgr, bool new) {
ns_server_attach(mgr->sctx, &client->sctx);
get_clienttask(mgr, &client->task);
result = dns_message_create(client->mctx,
DNS_MESSAGE_INTENTPARSE,
&client->message);
if (result != ISC_R_SUCCESS) {
goto cleanup;
}
dns_message_create(client->mctx, DNS_MESSAGE_INTENTPARSE,
&client->message);
client->sendbuf = isc_mem_get(client->mctx,
NS_CLIENT_SEND_BUFFER_SIZE);