From e1bea4eaf57bd81189793786b450720ab8fef4e7 Mon Sep 17 00:00:00 2001 From: Rafal Szczesniak Date: Wed, 16 Nov 2005 19:55:27 +0000 Subject: 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) --- source4/libnet/libnet_lookup.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source4/libnet/libnet_lookup.c') 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; } -- cgit