summaryrefslogtreecommitdiff
path: root/source4/libnet
diff options
context:
space:
mode:
authorRafal Szczesniak <mimir@samba.org>2005-11-16 19:55:27 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:46:21 -0500
commite1bea4eaf57bd81189793786b450720ab8fef4e7 (patch)
tree3cb4ea72ae69ea4f4d17b56b2bb5f4bf416707de /source4/libnet
parent27b9d5652ed212fc46ade4339ee167152bd870b3 (diff)
downloadsamba-e1bea4eaf57bd81189793786b450720ab8fef4e7.tar.gz
samba-e1bea4eaf57bd81189793786b450720ab8fef4e7.tar.bz2
samba-e1bea4eaf57bd81189793786b450720ab8fef4e7.zip
r11747: Move buffer allocation to libnet_Lookup function so that the
caller is not required to ensure it. rafal (This used to be commit 85456e6c0b50540d9f6ae15a460148a328cf002c)
Diffstat (limited to 'source4/libnet')
-rw-r--r--source4/libnet/libnet_lookup.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source4/libnet/libnet_lookup.c b/source4/libnet/libnet_lookup.c
index 010d30ac4a..7cc05324d6 100644
--- a/source4/libnet/libnet_lookup.c
+++ b/source4/libnet/libnet_lookup.c
@@ -50,6 +50,7 @@ struct composite_context *libnet_Lookup_send(struct libnet_context *ctx,
struct composite_context *c;
struct lookup_state *s;
const char** methods;
+ const char* address = talloc_array(ctx, const char, 16);
if (!io) return NULL;
@@ -68,7 +69,7 @@ struct composite_context *libnet_Lookup_send(struct libnet_context *ctx,
s->hostname.name = talloc_strdup(s, io->in.hostname);
s->hostname.type = io->in.type;
s->hostname.scope = NULL;
- s->address = io->out.address;
+ s->address = &address;
/* name resolution methods */
if (io->in.methods) {
@@ -109,6 +110,10 @@ NTSTATUS libnet_Lookup_recv(struct composite_context *c, TALLOC_CTX *mem_ctx,
s = talloc_get_type(c->private_data, struct lookup_state);
status = resolve_name_recv(s->resolve_ctx, mem_ctx, s->address);
+ if (NT_STATUS_IS_OK(status)) {
+ io->out.address = s->address;
+ }
+
return status;
}