summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafal Szczesniak <mimir@samba.org>2007-05-08 22:08:26 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:52:16 -0500
commit665065a1df9a6fff2c2f26d72b7b3453fcb93d30 (patch)
tree0d885c8f6170807f4b1caf32602b757083c44570
parentda7f449a07a30cb03d744f155861a7e7318809d6 (diff)
downloadsamba-665065a1df9a6fff2c2f26d72b7b3453fcb93d30.tar.gz
samba-665065a1df9a6fff2c2f26d72b7b3453fcb93d30.tar.bz2
samba-665065a1df9a6fff2c2f26d72b7b3453fcb93d30.zip
r22764: - replace talloc_zero with composite_create
- use event context provided with libnet context instead of creating a new one rafal (This used to be commit ce8414b3daad335eac356a393f1653e2e10e2640)
-rw-r--r--source4/libnet/libnet_lookup.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/source4/libnet/libnet_lookup.c b/source4/libnet/libnet_lookup.c
index ebf9b4842d..1c60bfc41d 100644
--- a/source4/libnet/libnet_lookup.c
+++ b/source4/libnet/libnet_lookup.c
@@ -59,21 +59,13 @@ struct composite_context *libnet_Lookup_send(struct libnet_context *ctx,
const char** methods;
/* allocate context and state structures */
- c = talloc_zero(NULL, struct composite_context);
+ c = composite_create(ctx, ctx->event_ctx);
if (c == NULL) return NULL;
s = talloc_zero(c, struct lookup_state);
- if (s == NULL) {
- composite_error(c, NT_STATUS_NO_MEMORY);
- return c;
- }
-
- /* prepare event context */
- c->event_ctx = event_context_find(c);
- if (c->event_ctx == NULL) {
- composite_error(c, NT_STATUS_NO_MEMORY);
- return c;
- }
+ if (composite_nomem(s, c)) return c;
+
+ c->private_data = s;
if (io == NULL || io->in.hostname == NULL) {
composite_error(c, NT_STATUS_INVALID_PARAMETER);
@@ -92,14 +84,11 @@ struct composite_context *libnet_Lookup_send(struct libnet_context *ctx,
methods = ctx->name_res_methods;
}
- c->private_data = s;
- c->state = COMPOSITE_STATE_IN_PROGRESS;
-
/* send resolve request */
cresolve_req = resolve_name_send(&s->hostname, c->event_ctx, methods);
+ if (composite_nomem(cresolve_req, c)) return c;
composite_continue(c, cresolve_req, continue_name_resolved, c);
-
return c;
}