Revert "FAILS!!! why??? libcli/nbt: avoid talloc_reference() in nbt_name_*_send()"
authorStefan Metzmacher <metze@samba.org>
Fri, 9 Aug 2013 09:57:03 +0000 (11:57 +0200)
committerStefan Metzmacher <metze@samba.org>
Mon, 18 Feb 2019 11:38:33 +0000 (12:38 +0100)
This reverts commit 2bf76cf26c5b122be1a3c22524ef256f89afe2e6.

libcli/nbt/nbtsocket.c

index 3cf527f6431643dbd9eea662175186ba7275a096..33d53fba9939c88eb6c3327793ea47acad4ab822 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                   = socket_address_copy(req, dest);
-       if (req->dest == NULL) goto failed;
+       req->dest                   = dest;
+       if (talloc_reference(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 = socket_address_copy(req, dest);
-       if (req>dest == NULL) goto failed;
+       req->dest = dest;
+       if (talloc_reference(req, dest) == NULL) goto failed;
        req->state     = NBT_REQUEST_SEND;
        req->is_reply = true;