summaryrefslogtreecommitdiff
path: root/source4/librpc/rpc/dcerpc_sock.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/librpc/rpc/dcerpc_sock.c')
-rw-r--r--source4/librpc/rpc/dcerpc_sock.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/source4/librpc/rpc/dcerpc_sock.c b/source4/librpc/rpc/dcerpc_sock.c
index 58fca4ce37..a911dba825 100644
--- a/source4/librpc/rpc/dcerpc_sock.c
+++ b/source4/librpc/rpc/dcerpc_sock.c
@@ -327,12 +327,15 @@ static struct composite_context *dcerpc_pipe_open_socket_send(TALLOC_CTX *mem_ct
s->conn = cn;
s->transport = transport;
if (localaddr) {
- s->localaddr = talloc_reference(c, localaddr);
+ s->localaddr = socket_address_copy(s, localaddr);
if (composite_nomem(s->localaddr, c)) return c;
}
- s->server = talloc_reference(c, server);
+ s->server = socket_address_copy(s, server);
if (composite_nomem(s->server, c)) return c;
- s->target_hostname = talloc_reference(s, target_hostname);
+ if (target_hostname) {
+ s->target_hostname = talloc_strdup(s, target_hostname);
+ if (composite_nomem(s->target_hostname, c)) return c;
+ }
s->sock = talloc(cn, struct sock_private);
if (composite_nomem(s->sock, c)) return c;
@@ -342,7 +345,10 @@ static struct composite_context *dcerpc_pipe_open_socket_send(TALLOC_CTX *mem_ct
talloc_steal(s->sock, s->socket_ctx);
- s->sock->path = talloc_reference(s->sock, full_path);
+ if (full_path != NULL) {
+ s->sock->path = talloc_strdup(s->sock, full_path);
+ if (composite_nomem(s->sock->path, c)) return c;
+ }
conn_req = socket_connect_send(s->socket_ctx, s->localaddr, s->server, 0,
c->event_ctx);