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>
Tue, 10 Apr 2018 08:14:15 +0000 (10:14 +0200)
This reverts commit 2bf76cf26c5b122be1a3c22524ef256f89afe2e6.

libcli/nbt/nbtsocket.c

index 92bd86aebb9dfd4cda92afc4a26252b9e0545ea5..711e39cbdc5a08c7714eda137dd8a2f5eb8d3b25 100644 (file)
@@ -386,8 +386,8 @@ struct nbt_name_request *nbt_name_request_send(struct nbt_name_socket *nbtsock,
        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) {
@@ -445,8 +445,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;