diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-01-22 01:37:48 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:09:06 -0500 |
commit | d069c368fbd900f9c6e22d7dccdd84c5202997a1 (patch) | |
tree | 5c23bfdb02ec6824e522d212874802e0cfa63f3a /source4/libcli/resolve | |
parent | b9a1e9a6677613865474c3c66b443b1c9e54c408 (diff) | |
download | samba-d069c368fbd900f9c6e22d7dccdd84c5202997a1.tar.gz samba-d069c368fbd900f9c6e22d7dccdd84c5202997a1.tar.bz2 samba-d069c368fbd900f9c6e22d7dccdd84c5202997a1.zip |
r4919: if a caller doesn't provide an event context to the resolver library,
then create one. This fixes a crash in the RAW-NEGNOWAIT test for
'host' resolution.
(This used to be commit 3268d523cc381b9b3077f794bb53daf0865d139c)
Diffstat (limited to 'source4/libcli/resolve')
-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; |