From a308204aa1b431466b1fd12e6a69e411fea82f19 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 15 Feb 2024 17:47:45 +0100 Subject: [PATCH] s4:libcli/dgram: make use of socket_address_copy() This avoids talloc_reference... BUG: https://bugzilla.samba.org/show_bug.cgi?id=15620 Signed-off-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett (cherry picked from commit 77f4f1c7dbaa2bb04d59d908923f6d11fd514da2) --- source4/libcli/dgram/dgramsocket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source4/libcli/dgram/dgramsocket.c b/source4/libcli/dgram/dgramsocket.c index dc5dd796bc0..cd0628ac834 100644 --- a/source4/libcli/dgram/dgramsocket.c +++ b/source4/libcli/dgram/dgramsocket.c @@ -224,8 +224,8 @@ NTSTATUS nbt_dgram_send(struct nbt_dgram_socket *dgmsock, req = talloc(dgmsock, struct nbt_dgram_request); if (req == NULL) goto failed; - req->dest = dest; - if (talloc_reference(req, dest) == NULL) goto failed; + req->dest = socket_address_copy(req, dest); + if (req->dest == NULL) goto failed; ndr_err = ndr_push_struct_blob(&req->encoded, req, packet, (ndr_push_flags_fn_t)ndr_push_nbt_dgram_packet); -- 2.47.2