From 72dec3c1f169d77a0456000d4fa512e8bd2d9007 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 8 Aug 2013 18:38:12 +0200 Subject: s4:nbt_server: avoid talloc_reference() Signed-off-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett --- source4/nbt_server/wins/wins_dns_proxy.c | 5 +++-- source4/nbt_server/wins/winsdb.c | 2 +- source4/nbt_server/wins/winsserver.c | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) (limited to 'source4/nbt_server') diff --git a/source4/nbt_server/wins/wins_dns_proxy.c b/source4/nbt_server/wins/wins_dns_proxy.c index 4ebfc05fd7..7b85f8d9fe 100644 --- a/source4/nbt_server/wins/wins_dns_proxy.c +++ b/source4/nbt_server/wins/wins_dns_proxy.c @@ -27,6 +27,7 @@ #include "libcli/composite/composite.h" #include "smbd/service_task.h" #include "libcli/resolve/resolve.h" +#include "lib/socket/socket.h" struct wins_dns_proxy_state { struct nbt_name_socket *nbtsock; @@ -78,8 +79,8 @@ void nbtd_wins_dns_proxy_query(struct nbt_name_socket *nbtsock, if (!s) goto failed; s->nbtsock = nbtsock; s->packet = talloc_steal(s, packet); - s->src = src; - if (!talloc_reference(s, src)) { + s->src = socket_address_copy(s, src); + if (s->src == NULL) { goto failed; } diff --git a/source4/nbt_server/wins/winsdb.c b/source4/nbt_server/wins/winsdb.c index 346ccc949b..9b1cd2c3bb 100644 --- a/source4/nbt_server/wins/winsdb.c +++ b/source4/nbt_server/wins/winsdb.c @@ -223,7 +223,7 @@ static NTSTATUS winsdb_addr_decode(struct winsdb_handle *h, struct winsdb_record if (!p) { /* support old entries, with only the address */ addr->address = (const char *)talloc_steal(addr, val->data); - addr->wins_owner = talloc_reference(addr, rec->wins_owner); + addr->wins_owner = talloc_strdup(addr, rec->wins_owner); if (!addr->wins_owner) { status = NT_STATUS_NO_MEMORY; goto failed; diff --git a/source4/nbt_server/wins/winsserver.c b/source4/nbt_server/wins/winsserver.c index e9598bab8c..3cd7d430f9 100644 --- a/source4/nbt_server/wins/winsserver.c +++ b/source4/nbt_server/wins/winsserver.c @@ -411,8 +411,8 @@ static void wins_register_wack(struct nbt_name_socket *nbtsock, s->rec = talloc_steal(s, rec); s->reg_address = packet->additional[0].rdata.netbios.addresses[0].ipaddr; s->new_type = new_type; - s->src = src; - if (talloc_reference(s, src) == NULL) goto failed; + s->src = socket_address_copy(s, src); + if (s->src == NULL) goto failed; s->io.in.nbtd_server = iface->nbtsrv; s->io.in.nbt_port = lpcfg_nbt_port(iface->nbtsrv->task->lp_ctx); -- cgit