From: Stefan Metzmacher Date: Thu, 15 Feb 2024 16:47:45 +0000 (+0100) Subject: s4:libcli/dgram: make use of socket_address_copy() X-Git-Tag: samba-4.19.8~57 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a308204aa1b431466b1fd12e6a69e411fea82f19;p=thirdparty%2Fsamba.git 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) --- 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);