summaryrefslogtreecommitdiff
path: root/source4/librpc/rpc/dcerpc_connect.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2013-08-08 13:56:51 +0200
committerAndrew Bartlett <abartlet@samba.org>2013-08-12 16:48:46 +1200
commitae6166a3c10d3ce9f9a0d08dcbfcc8afd72ca461 (patch)
tree3eadbf0b231becd27d20d0c3925d7e8445b8cea7 /source4/librpc/rpc/dcerpc_connect.c
parentb055b3118d9c2159e9d5a42830328cfc103f9555 (diff)
downloadsamba-ae6166a3c10d3ce9f9a0d08dcbfcc8afd72ca461.tar.gz
samba-ae6166a3c10d3ce9f9a0d08dcbfcc8afd72ca461.tar.bz2
samba-ae6166a3c10d3ce9f9a0d08dcbfcc8afd72ca461.zip
s4:librpc: avoid talloc_reference() in dcerpc_epm_map_binding_send()
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/librpc/rpc/dcerpc_connect.c')
-rw-r--r--source4/librpc/rpc/dcerpc_connect.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/source4/librpc/rpc/dcerpc_connect.c b/source4/librpc/rpc/dcerpc_connect.c
index 280b7aeb0e..eb53a115e3 100644
--- a/source4/librpc/rpc/dcerpc_connect.c
+++ b/source4/librpc/rpc/dcerpc_connect.c
@@ -323,9 +323,18 @@ static struct composite_context* dcerpc_pipe_connect_ncacn_ip_tcp_send(TALLOC_CT
/* store input parameters in state structure */
s->io = *io;
- s->localaddr = talloc_reference(c, io->binding->localaddress);
- s->host = talloc_reference(c, io->binding->host);
- s->target_hostname = talloc_reference(c, io->binding->target_hostname);
+ if (io->binding->localaddress != NULL) {
+ s->localaddr = talloc_strdup(s, io->binding->localaddress);
+ if (composite_nomem(s->localaddr, c)) return c;
+ }
+ if (io->binding->host != NULL) {
+ s->host = talloc_strdup(s, io->binding->host);
+ if (composite_nomem(s->host, c)) return c;
+ }
+ if (io->binding->target_hostname != NULL) {
+ s->target_hostname = talloc_strdup(s, io->binding->target_hostname);
+ if (composite_nomem(s->target_hostname, c)) return c;
+ }
/* port number is a binding endpoint here */
s->port = atoi(io->binding->endpoint);