summaryrefslogtreecommitdiff
path: root/source4/libcli/resolve/resolve.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/libcli/resolve/resolve.c')
-rw-r--r--source4/libcli/resolve/resolve.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/source4/libcli/resolve/resolve.c b/source4/libcli/resolve/resolve.c
index 33ace09443..d89b50e430 100644
--- a/source4/libcli/resolve/resolve.c
+++ b/source4/libcli/resolve/resolve.c
@@ -136,19 +136,13 @@ struct composite_context *resolve_name_send(struct resolve_context *ctx,
struct composite_context *c;
struct resolve_state *state;
- c = composite_create(event_ctx, event_ctx);
- if (c == NULL) return NULL;
-
- if (ctx == NULL) {
- composite_error(c, NT_STATUS_INVALID_PARAMETER);
- return c;
+ if (ctx == NULL || event_ctx == NULL) {
+ return NULL;
}
- if (event_ctx == NULL) {
- c->event_ctx = event_context_init(c);
- } else {
- c->event_ctx = talloc_reference(c, event_ctx);
- }
+ c = composite_create(ctx, event_ctx);
+ if (c == NULL) return NULL;
+
if (composite_nomem(c->event_ctx, c)) return c;
state = talloc(c, struct resolve_state);