1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

r11747: Move buffer allocation to libnet_Lookup function so that the

caller is not required to ensure it.

rafal
This commit is contained in:
Rafal Szczesniak 2005-11-16 19:55:27 +00:00 committed by Gerald (Jerry) Carter
parent 7cf6b307bc
commit 85456e6c0b

View File

@ -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;
}