mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-01 06:55:30 +00:00
Merge branch '4343-cid-465861-unnecessary-null-check-in-ns__client_setup' into 'main'
Remove unnecessary NULL-checks in ns__client_setup() Closes #4343 See merge request isc-projects/bind9!8347
This commit is contained in:
@@ -2290,11 +2290,8 @@ ns__client_setup(ns_client_t *client, ns_clientmgr_t *mgr, bool new) {
|
|||||||
isc_result_t result;
|
isc_result_t result;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Caller must be holding the manager lock.
|
|
||||||
*
|
|
||||||
* Note: creating a client does not add the client to the
|
* Note: creating a client does not add the client to the
|
||||||
* manager's client list or set the client's manager pointer.
|
* manager's client list, the caller is responsible for that.
|
||||||
* The caller is responsible for that.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (new) {
|
if (new) {
|
||||||
@@ -2358,18 +2355,10 @@ ns__client_setup(ns_client_t *client, ns_clientmgr_t *mgr, bool new) {
|
|||||||
return (ISC_R_SUCCESS);
|
return (ISC_R_SUCCESS);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
if (client->sendbuf != NULL) {
|
isc_mem_put(client->manager->send_mctx, client->sendbuf,
|
||||||
isc_mem_put(client->manager->send_mctx, client->sendbuf,
|
NS_CLIENT_SEND_BUFFER_SIZE);
|
||||||
NS_CLIENT_SEND_BUFFER_SIZE);
|
dns_message_detach(&client->message);
|
||||||
}
|
ns_clientmgr_detach(&client->manager);
|
||||||
|
|
||||||
if (client->message != NULL) {
|
|
||||||
dns_message_detach(&client->message);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (client->manager != NULL) {
|
|
||||||
ns_clientmgr_detach(&client->manager);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user