diff options
author | Stefan Metzmacher <metze@samba.org> | 2013-08-08 18:38:12 +0200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2013-08-12 16:48:51 +1200 |
commit | 72dec3c1f169d77a0456000d4fa512e8bd2d9007 (patch) | |
tree | ae3d80e337f002d169f16329e93652548b020594 /source4/nbt_server | |
parent | 270aee56f11a2bf6c1d1e2c3c96767278fd22743 (diff) | |
download | samba-72dec3c1f169d77a0456000d4fa512e8bd2d9007.tar.gz |
s4:nbt_server: avoid talloc_reference()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/nbt_server')
-rw-r--r-- | source4/nbt_server/wins/wins_dns_proxy.c | 5 | ||||
-rw-r--r-- | source4/nbt_server/wins/winsdb.c | 2 | ||||
-rw-r--r-- | source4/nbt_server/wins/winsserver.c | 4 |
3 files changed, 6 insertions, 5 deletions
diff --git a/source4/nbt_server/wins/wins_dns_proxy.c b/source4/nbt_server/wins/wins_dns_proxy.c index 4ebfc05fd76..7b85f8d9fea 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 346ccc949bb..9b1cd2c3bb6 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 e9598bab8c4..3cd7d430f99 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); |