summaryrefslogtreecommitdiffstats
path: root/lib/ns/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ns/client.c')
-rw-r--r--lib/ns/client.c34
1 files changed, 8 insertions, 26 deletions
diff --git a/lib/ns/client.c b/lib/ns/client.c
index 5ed64fd..a62343b 100644
--- a/lib/ns/client.c
+++ b/lib/ns/client.c
@@ -1672,9 +1672,7 @@ ns__client_put_cb(void *client0) {
dns_message_detach(&client->message);
- if (client->manager != NULL) {
- ns_clientmgr_detach(&client->manager);
- }
+ ns_clientmgr_detach(&client->manager);
/*
* Detaching the task must be done after unlinking from
@@ -2322,11 +2320,8 @@ ns__client_setup(ns_client_t *client, ns_clientmgr_t *mgr, bool new) {
isc_result_t result;
/*
- * Caller must be holding the manager lock.
- *
* Note: creating a client does not add the client to the
- * manager's client list or set the client's manager pointer.
- * The caller is responsible for that.
+ * manager's client list, the caller is responsible for that.
*/
if (new) {
@@ -2402,26 +2397,13 @@ ns__client_setup(ns_client_t *client, ns_clientmgr_t *mgr, bool new) {
return (ISC_R_SUCCESS);
cleanup:
- if (client->sendbuf != NULL) {
- isc_mem_put(client->manager->send_mctx, client->sendbuf,
- NS_CLIENT_SEND_BUFFER_SIZE);
- }
-
- if (client->message != NULL) {
- dns_message_detach(&client->message);
- }
-
- if (client->task != NULL) {
- isc_task_detach(&client->task);
- }
-
- if (client->manager != NULL) {
- ns_clientmgr_detach(&client->manager);
- }
+ isc_mem_put(client->manager->send_mctx, client->sendbuf,
+ NS_CLIENT_SEND_BUFFER_SIZE);
+ dns_message_detach(&client->message);
+ isc_task_detach(&client->task);
+ ns_clientmgr_detach(&client->manager);
isc_mem_detach(&client->mctx);
- if (client->sctx != NULL) {
- ns_server_detach(&client->sctx);
- }
+ ns_server_detach(&client->sctx);
return (result);
}