summaryrefslogtreecommitdiff
path: root/source4/libcli/raw/clisocket.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-05-23 16:24:07 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-05-23 16:24:07 +0200
commitcceac63aaab26a72e2f3fd150dd1e4e83a0e5279 (patch)
tree6203cca724fc5f17f068e3fd4d0b403fdff3f8f9 /source4/libcli/raw/clisocket.c
parent7c7880695b02df4cbe0faab959846c63d0cc0536 (diff)
parent72fce654072b2d7317ff21c95558bd365701d5dd (diff)
downloadsamba-cceac63aaab26a72e2f3fd150dd1e4e83a0e5279.tar.gz
samba-cceac63aaab26a72e2f3fd150dd1e4e83a0e5279.tar.bz2
samba-cceac63aaab26a72e2f3fd150dd1e4e83a0e5279.zip
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into v4-0-wsgi
Conflicts: source/scripting/python/samba/provision.py (This used to be commit d27de633656f8a699222df77c4c58326890889a2)
Diffstat (limited to 'source4/libcli/raw/clisocket.c')
-rw-r--r--source4/libcli/raw/clisocket.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/source4/libcli/raw/clisocket.c b/source4/libcli/raw/clisocket.c
index 1dcf2d1c53..49838e8a1c 100644
--- a/source4/libcli/raw/clisocket.c
+++ b/source4/libcli/raw/clisocket.c
@@ -59,12 +59,7 @@ struct composite_context *smbcli_sock_connect_send(TALLOC_CTX *mem_ctx,
if (result == NULL) goto failed;
result->state = COMPOSITE_STATE_IN_PROGRESS;
- if (event_ctx != NULL) {
- result->event_ctx = talloc_reference(result, event_ctx);
- } else {
- result->event_ctx = event_context_init(result);
- }
-
+ result->event_ctx = talloc_reference(result, event_ctx);
if (result->event_ctx == NULL) goto failed;
state = talloc(result, struct sock_connect_state);
@@ -202,6 +197,11 @@ _PUBLIC_ struct smbcli_socket *smbcli_sock_connect_byname(const char *host, cons
TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
struct smbcli_socket *result;
+ if (event_ctx == NULL) {
+ DEBUG(0, ("Invalid NULL event context passed in as parameter\n"));
+ return NULL;
+ }
+
if (tmp_ctx == NULL) {
DEBUG(0, ("talloc_new failed\n"));
return NULL;
@@ -214,16 +214,6 @@ _PUBLIC_ struct smbcli_socket *smbcli_sock_connect_byname(const char *host, cons
return NULL;
}
- if (event_ctx == NULL) {
- event_ctx = event_context_init(mem_ctx);
- }
-
- if (event_ctx == NULL) {
- DEBUG(0, ("event_context_init failed\n"));
- talloc_free(tmp_ctx);
- return NULL;
- }
-
/* allow hostnames of the form NAME#xx and do a netbios lookup */
if ((p = strchr(name, '#'))) {
name_type = strtol(p+1, NULL, 16);