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) {
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->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);
+ ns_clientmgr_detach(&client->manager);
return (result);
}