diff options
-rw-r--r-- | source4/libcli/resolve/resolve.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source4/libcli/resolve/resolve.c b/source4/libcli/resolve/resolve.c index 013403fd9c..ef906d4ed0 100644 --- a/source4/libcli/resolve/resolve.c +++ b/source4/libcli/resolve/resolve.c @@ -138,7 +138,12 @@ struct smbcli_composite *resolve_name_send(struct nbt_name *name, struct event_c c->state = SMBCLI_REQUEST_SEND; c->private = state; - c->event_ctx = talloc_reference(c, event_ctx); + if (event_ctx == NULL) { + c->event_ctx = event_context_init(c); + if (c->event_ctx == NULL) goto failed; + } else { + c->event_ctx = talloc_reference(c, event_ctx); + } state->req = setup_next_method(c); if (state->req == NULL) goto failed; |