summaryrefslogtreecommitdiffstats
path: root/source/rpc_client/cli_netlogon.c
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2007-12-21 15:12:40 +0100
committerGünther Deschner <gd@samba.org>2007-12-21 15:12:40 +0100
commitb7383818168863a7ba43c2456f8c44e96e76707a (patch)
tree788f14f4e49e10ef02faf4194b2ab41148e014f9 /source/rpc_client/cli_netlogon.c
parent763e13315fc71237b14a186810bc201e725648f5 (diff)
downloadsamba-b7383818168863a7ba43c2456f8c44e96e76707a.tar.gz
samba-b7383818168863a7ba43c2456f8c44e96e76707a.tar.xz
samba-b7383818168863a7ba43c2456f8c44e96e76707a.zip
Kill fstring in getdcname & getanydcname return.
Guenther
Diffstat (limited to 'source/rpc_client/cli_netlogon.c')
-rw-r--r--source/rpc_client/cli_netlogon.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/source/rpc_client/cli_netlogon.c b/source/rpc_client/cli_netlogon.c
index 3cb5827e73d..26d2124da03 100644
--- a/source/rpc_client/cli_netlogon.c
+++ b/source/rpc_client/cli_netlogon.c
@@ -383,7 +383,7 @@ NTSTATUS rpccli_netlogon_logon_ctrl2(struct rpc_pipe_client *cli, TALLOC_CTX *me
WERROR rpccli_netlogon_getanydcname(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx, const char *mydcname,
- const char *domainname, fstring newdcname)
+ const char *domainname, char **newdcname)
{
prs_struct qbuf, rbuf;
NET_Q_GETANYDCNAME q;
@@ -410,8 +410,9 @@ WERROR rpccli_netlogon_getanydcname(struct rpc_pipe_client *cli,
result = r.status;
- if (W_ERROR_IS_OK(result)) {
- rpcstr_pull_unistr2_fstring(newdcname, &r.uni_dcname);
+ if (W_ERROR_IS_OK(result) && newdcname) {
+ *newdcname = rpcstr_pull_unistr2_talloc(mem_ctx, &r.uni_dcname);
+ W_ERROR_HAVE_NO_MEMORY(*newdcname);
}
return result;
@@ -421,7 +422,7 @@ WERROR rpccli_netlogon_getanydcname(struct rpc_pipe_client *cli,
WERROR rpccli_netlogon_getdcname(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx, const char *mydcname,
- const char *domainname, fstring newdcname)
+ const char *domainname, char **newdcname)
{
prs_struct qbuf, rbuf;
NET_Q_GETDCNAME q;
@@ -448,8 +449,9 @@ WERROR rpccli_netlogon_getdcname(struct rpc_pipe_client *cli,
result = r.status;
- if (W_ERROR_IS_OK(result)) {
- rpcstr_pull_unistr2_fstring(newdcname, &r.uni_dcname);
+ if (W_ERROR_IS_OK(result) && newdcname) {
+ *newdcname = rpcstr_pull_unistr2_talloc(mem_ctx, &r.uni_dcname);
+ W_ERROR_HAVE_NO_MEMORY(*newdcname);
}
return result;