From: Stefan Metzmacher Date: Thu, 8 Aug 2013 16:11:23 +0000 (+0200) Subject: libcli/nbt: avoid talloc_reference() in nbt_name_*_send() X-Git-Tag: ldb-2.1.1~191 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c80a51c69d6ae849c859e58aae85c7c98c927963;p=thirdparty%2Fsamba.git libcli/nbt: avoid talloc_reference() in nbt_name_*_send() Signed-off-by: Stefan Metzmacher Reviewed-by: Andreas Schneider --- diff --git a/libcli/nbt/nbtsocket.c b/libcli/nbt/nbtsocket.c index 38a2192fbcd..f682b233fd1 100644 --- a/libcli/nbt/nbtsocket.c +++ b/libcli/nbt/nbtsocket.c @@ -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;