summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
Diffstat (limited to 'source4/libcli')
-rw-r--r--source4/libcli/composite/composite.c6
-rw-r--r--source4/libcli/dgram/dgramsocket.c2
-rw-r--r--source4/libcli/raw/clisocket.c5
-rw-r--r--source4/libcli/smb_composite/connect.c2
-rw-r--r--source4/libcli/wrepl/winsrepl.c4
5 files changed, 7 insertions, 12 deletions
diff --git a/source4/libcli/composite/composite.c b/source4/libcli/composite/composite.c
index ab32175d00..7262ebce54 100644
--- a/source4/libcli/composite/composite.c
+++ b/source4/libcli/composite/composite.c
@@ -42,11 +42,7 @@ _PUBLIC_ struct composite_context *composite_create(TALLOC_CTX *mem_ctx,
c = talloc_zero(mem_ctx, struct composite_context);
if (!c) return NULL;
c->state = COMPOSITE_STATE_IN_PROGRESS;
- c->event_ctx = talloc_reference(c, ev);
- if (!c->event_ctx) {
- talloc_free(c);
- return NULL;
- }
+ c->event_ctx = ev;
return c;
}
diff --git a/source4/libcli/dgram/dgramsocket.c b/source4/libcli/dgram/dgramsocket.c
index 751706d2c5..365960edb6 100644
--- a/source4/libcli/dgram/dgramsocket.c
+++ b/source4/libcli/dgram/dgramsocket.c
@@ -166,7 +166,7 @@ struct nbt_dgram_socket *nbt_dgram_socket_init(TALLOC_CTX *mem_ctx,
dgmsock = talloc(mem_ctx, struct nbt_dgram_socket);
if (dgmsock == NULL) goto failed;
- dgmsock->event_ctx = talloc_reference(dgmsock, event_ctx);
+ dgmsock->event_ctx = event_ctx;
if (dgmsock->event_ctx == NULL) goto failed;
status = socket_create("ip", SOCKET_TYPE_DGRAM, &dgmsock->sock, 0);
diff --git a/source4/libcli/raw/clisocket.c b/source4/libcli/raw/clisocket.c
index b9e83218dd..02da4917e3 100644
--- a/source4/libcli/raw/clisocket.c
+++ b/source4/libcli/raw/clisocket.c
@@ -61,7 +61,7 @@ struct composite_context *smbcli_sock_connect_send(TALLOC_CTX *mem_ctx,
if (result == NULL) goto failed;
result->state = COMPOSITE_STATE_IN_PROGRESS;
- result->event_ctx = talloc_reference(result, event_ctx);
+ result->event_ctx = event_ctx;
if (result->event_ctx == NULL) goto failed;
state = talloc(result, struct sock_connect_state);
@@ -118,8 +118,7 @@ static void smbcli_sock_connect_recv_conn(struct composite_context *ctx)
state->result->port = port;
state->result->hostname = talloc_steal(sock, state->host_name);
- state->result->event.ctx =
- talloc_reference(state->result, state->ctx->event_ctx);
+ state->result->event.ctx = state->ctx->event_ctx;
if (composite_nomem(state->result->event.ctx, state->ctx)) return;
composite_done(state->ctx);
diff --git a/source4/libcli/smb_composite/connect.c b/source4/libcli/smb_composite/connect.c
index a5d05b7af1..9a19771bc0 100644
--- a/source4/libcli/smb_composite/connect.c
+++ b/source4/libcli/smb_composite/connect.c
@@ -466,7 +466,7 @@ struct composite_context *smb_composite_connect_send(struct smb_composite_connec
c = talloc_zero(mem_ctx, struct composite_context);
if (c == NULL) goto failed;
- c->event_ctx = talloc_reference(c, event_ctx);
+ c->event_ctx = event_ctx;
if (c->event_ctx == NULL) goto failed;
state = talloc_zero(c, struct connect_state);
diff --git a/source4/libcli/wrepl/winsrepl.c b/source4/libcli/wrepl/winsrepl.c
index 48a6abba9d..849511b606 100644
--- a/source4/libcli/wrepl/winsrepl.c
+++ b/source4/libcli/wrepl/winsrepl.c
@@ -171,7 +171,7 @@ struct wrepl_socket *wrepl_socket_init(TALLOC_CTX *mem_ctx,
wrepl_socket = talloc_zero(mem_ctx, struct wrepl_socket);
if (!wrepl_socket) return NULL;
- wrepl_socket->event.ctx = talloc_reference(wrepl_socket, event_ctx);
+ wrepl_socket->event.ctx = event_ctx;
if (!wrepl_socket->event.ctx) goto failed;
wrepl_socket->iconv_convenience = iconv_convenience;
@@ -205,7 +205,7 @@ struct wrepl_socket *wrepl_socket_merge(TALLOC_CTX *mem_ctx,
wrepl_socket = talloc_zero(mem_ctx, struct wrepl_socket);
if (wrepl_socket == NULL) goto failed;
- wrepl_socket->event.ctx = talloc_reference(wrepl_socket, event_ctx);
+ wrepl_socket->event.ctx = event_ctx;
if (wrepl_socket->event.ctx == NULL) goto failed;
wrepl_socket->sock = sock;