libcli/nbt: avoid talloc_reference() in nbt_name_*_send() master3-fix
authorStefan Metzmacher <metze@samba.org>
Thu, 8 Aug 2013 16:11:23 +0000 (18:11 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 29 Oct 2019 13:37:16 +0000 (14:37 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
libcli/nbt/nbtsocket.c

index 38a2192fbcdacbb094032d4af2dd1440557c0bd3..f682b233fd179286c72dc3375874821f46b7e0aa 100644 (file)
@@ -387,8 +387,8 @@ struct nbt_name_request *nbt_name_request_send(TALLOC_CTX *mem_ctx,
        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) {
@@ -446,8 +446,8 @@ _PUBLIC_ NTSTATUS nbt_name_reply_send(struct nbt_name_socket *nbtsock,
        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;