summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}