req->is_reply = false;
req->timeout = timeout;
req->num_retries = retries;
- req->dest = dest;
- if (talloc_reference(req, dest) == NULL) goto failed;
+ req->dest = socket_address_copy(req, dest);
+ if (req->dest == NULL) goto failed;
/* we select a random transaction id unless the user supplied one */
if (request->name_trn_id == 0) {
NT_STATUS_HAVE_NO_MEMORY(req);
req->nbtsock = nbtsock;
- req->dest = dest;
- if (talloc_reference(req, dest) == NULL) goto failed;
+ req->dest = socket_address_copy(req, dest);
+ if (req->dest == NULL) goto failed;
req->state = NBT_REQUEST_SEND;
req->is_reply = true;